Draft: Add a Pytest-based Testsuite #1037
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This branch introduces a second testsuite, using pytest, in addition to the existing nose-based testsuite. The goal is to migrate the current testsuite to pytest, making it obsolete (see Issue 162).
Note that, if we want to use pytest features like test function parameterization (i.e. using a pytest decorator instead of having helper methods, which call another test method multiple times with different parameters),
the new testsuite will have a larger number of tests - nose sees e.g. a helper method which calls the actual test with 4 different parameter combinations and assert statements as a single test, pytest will report it as 4 tests.
Short feedback if we want to use pytest parameterization or just translate the current tests as they are with as few changes as possible would be appreciated. For an example how the tests would be rewritten, see e.g. commit dad90346f320a2447b2dd1d91a15c3a3e3342a18.
Upside would be that any failing call to a test method, which currently is hidden inside helper methods, would be directly reported by pytest without having to check manually which assertion failed, i.e. tests would be finer. Would also clearly separate the test data from the actual tests. Downside would be the need to rewrite significant parts of the testsuite and that there wouldn't be a 1:1 relation between the current and new testsuite, but a 1:n relation.