-
Task
-
Resolution: Won't Do
-
Minor
-
None
-
None
-
5
-
False
-
Requires information. See spike https://issues.redhat.com/browse/COST-4707
-
False
-
-
We currently use tox to run tests locally and pipenv to run them in CI. We should unify the ways tests are run and move the tests to pytest run by tox.
pytest has a number of advantages over unittest:
- Tests are simpler to read and write. They are functions, not classes.
- pytest uses fixtures instead of setup/teardown methods. Fixtures are more flexible and easier to reuse.
- The built-in fixtures such as monkeypatch and tmp_path provide convenient ways to modify objects and create temporary files for testing
- Marks, such as parametrize and xfail, are great for running the same test against different inputs or handling flaky tests
- Custom marks are a convenient way to run groups of tests
- Convenient ways to open a debugger on test failure or only run the last failed tests
- There are many plugins that extend pytest, and we can easily write our own if needed
We do not have to change any existing tests since pytest can run unittest-style tests.
- is blocked by
-
COST-4707 Determine value and team impact of moving to pytest
- Closed