pytest Tutorial – Part 1

At PyConDE Berlin 2019 Florian Bruhin gave a really nice session about testing with pytest, which I try to recap here.

Writing Tests

If You want to work with pytest you can install it via:

pip install pytest

When you know basic python unittest fixtures, good news ahead:

pytest is compatible and will run your old unittest classes as well, but pytest doesn’t need to have a testclass derived from some subclass.

It is sufficient to have a single python file which name starts with test_ containing a function which name also starts with test_ Continue reading “pytest Tutorial – Part 1”

SQL-LIKE and wildcards

Se_en represents a pattern with a wildcard character. The _ means you can substitute any individual character here without breaking the pattern. The names Seven and Se7en both match this pattern.

The percentage sign % is another wildcard character that can be used with LIKE.

Software Testing Concepts – Part 1

My Tale of Woe

When I graduated from university and had my first job as a software engineer at Harman Becker Automotive Systems GmbH I should do the parental leave cover for a colleague. He showed me his project, gave me some info e.g. contact person and went off to Canada.

Literally on the second day he was away, the phone started to ring. The OEM had a A++ blocker issue found in the software and everything pointed to the component I was now maintaining. Continue reading “Software Testing Concepts – Part 1”

Python Package parameterized

Stackoverflowing around I found this nice package

https://github.com/wolever/parameterized

Parameterized testing in Python sucks.

parameterized fixes that. For everything. Parameterized testing for nose, parameterized testing for py.test, parameterized testing for unittest.

Reading this description I had very high expectations 🙂

so let’s see if the package can hold up to it. Continue reading “Python Package parameterized”

Calculator for Resistor Values

Calculator for 4 rings

1. Ring 2. Ring 3. Ring 4. Ring Value Tolerance
0Ω 0%

Calculator for 5 rings

1. Ring 2. Ring 3. Ring 4. Ring 5. Ring Value Tolerance
0Ω 0%

Invalid Host Header with npm run server

I got an “Invalid Host Header” error when running a VueJs app on a linux machine with npm run serve.

To work around this you can put the following code into you vue.config.js file:

module.exports = {
    // options...
    devServer: {
        disableHostCheck: true,
    }
}