Update unit-test guidelines to require independent testingSee original GitHub issue
Subject of the documentation
Now we have some tests where we test different cases sequentially inside one single function. This is not ideal as sometimes previous tests might have an unexpected impact on the following tests.
Imagine we test a function named
func we can build tests as follows:
class TestFunc: def test_case1(self): ... def test_case2(self): ...
so that case1 and case2 are isolated.
In case we are just changing the values of the arguments, we can use Parametrizing tests to remove redundant code.
We do not have to refactor all existing code, but we should update the guidelines so that new tests or modified tests should be refactored.
If the documentation request is approved, would you be willing to submit a PR? (Help can be provided if you need assistance submitting a PR)
- Created 3 years ago
- Comments:8 (8 by maintainers)