Enable support for pytest as our test runner.
Review Request #12024 — Created Jan. 31, 2022 and submitted
This switches us to using pytest for running unit tests, along with a
couple of suitable plugins. pytest is maintained, as a wide ecosystem of
plugins, and offers us options for rethinking our testing infrastructure
down the road.For the moment, we're still building unit tests around Python's
unittest
library, Django'sdjango.test
, and Djblets's
djblets.testing
. We'll probably continue to do this for the
foreseeable future, since there are benefits to theunittest
-based
approach still, and switching everything over to pytest's view of
testing is a big project.The configuration has a number of warnings that we disable. As we finish
the move to Django 3.2, we'll be able to remove many of these.One important thing to note is that the
./reviewboard/manage.py test
command will still attempt to use the old test runner. Extensions use
that test runner as well, making that a tricky thing to cleanly switch
out.So technically, we currently have two test runners we're using, but
pytest will be the official way to run the test suite for Review Board
going forward.
Ran pytest.
Unit tests are currently broken on
release-5.0.x
, but pytest at least
has the same errors (at least until I had to kill the suite).This change was originally on
release-4.0.x
, where it passed the entire
suite.
- Change Summary:
-
- Removed an unused import.
- Fixed a docstring to reference the right product.
- Commits:
-
Summary ID 41d620754591dbc2fcb8d68facde01b6bb253b1c a7148dc6197dc7023be724a13fdd98a8f4d6a5d8 - Diff:
-
Revision 2 (+414 -56)
- Change Summary:
-
- Removed an unused import.
- Fixed a docstring to reference the right product.
- Commits:
-
Summary ID a7148dc6197dc7023be724a13fdd98a8f4d6a5d8 196dfdde0c94ac9549a7606ff7e911245c6aa286 - Diff:
-
Revision 3 (+412 -56)