Enable support for pytest as our test runner.

Review Request #12024 — Created Jan. 31, 2022 and submitted — Latest diff uploaded

Information

Review Board
release-5.0.x

Reviewers

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's django.test, and Djblets's
djblets.testing. We'll probably continue to do this for the
foreseeable future, since there are benefits to the unittest-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.

Commits

Files

    Loading...