4 ms·
Parametrized tests are quite powerful and you can be creative with them. For example, I am using them in integration testing (for this test, I need process A an
by vbernat 9y ago
Parametrized tests are quite powerful and you can be creative with them. For example, I am using them in integration testing (for this test, I need process A and process B as well as a string from set C): https://vincent.bernat.im/en/blog/2016-testing-pytest-linux-namespaces https://vincent.bernat.im/en/blog/2016-testing-pytest-linux-...
You can define the lifetime of each parameter (just the test, the class or the whole testing session). This makes it very flexible.
The use of "assert" is magic in the sense that in case of failure, you get helpful values. "assert a == b" will show you the values of "a" and "b" in case of failure.