• 
      

    Switch Django Evolution's test suite to use pytest.

    Review Request #11917 — Created Jan. 9, 2022 and submitted

    Information

    Django Evolution
    release-2.x

    Reviewers

    Historically, we've used nose as the test runner, with a custom test
    runner script responsible for setting up a Django environment for the
    given version of Django.

    Unfortunately, nose 1.x hasn't been updated in a long while, and isn't
    compatible with modern versions of Python 3. The forks also don't
    support Python 3 very well. nose2 does, but is so different that it's
    not a great option for us.

    Instead, we're moving to pytest. This is a much more modern test
    runner with a lot of interesting capabilities and a wide ecosystem of
    plugins.

    We now use this and define all our custom setup logic using pytest
    hooks in conftest.py. This handles Django setup, and adds a --db
    option for specifying which test database we want to use to run the
    suite.

    Developers can now run pytest directly to run the test suite. The old
    ./tests/runtests.py still works, but is deprecated, and merely wraps
    pytests anyway.

    Tested with manual test runs, using a variety of parameters.

    Ran the whole Python/Django compatibility matrix using tox. All
    tests passed.

    Summary ID
    Switch Django Evolution's test suite to use pytest.
    Historically, we've used `nose` as the test runner, with a custom test runner script responsible for setting up a Django environment for the given version of Django. Unfortunately, `nose` 1.x hasn't been updated in a long while, and isn't compatible with modern versions of Python 3. The forks also don't support Python 3 very well. `nose2` does, but is so different that it's not a great option for us. Instead, we're moving to `pytest`. This is a much more modern test runner with a lot of interesting capabilities and a wide ecosystem of plugins. We now use this and define all our custom setup logic using `pytest` hooks in `conftest.py`. This handles Django setup, and adds a `--db` option for specifying which test database we want to use to run the suite. Developers can now run `pytest` directly to run the test suite. The old `./tests/runtests.py` still works, but is deprecated, and merely wraps `pytests` anyway.
    a21532129495477d68b8844350e23a9134c42071
    david
    1. Ship It!
    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-2.x (7fc6846)