Does anyone ever run unit tests manually on the master branch?

Currently, running tests on the master branch results in 3k+ warnings, which makes it really difficult to troubleshoot failing tests.

For instance, I just added a failing test to openedx/core/djangoapps/theming/tests/test_views.py:

$ pytest openedx/core/djangoapps/theming/tests/test_views.py | wc -l
3276

I find it hard to believe that I’m the only one facing this problem. How do others resolve this?

Looks like these are almost entirely all RemovedInDjango40Warning, which we haven’t had a chance to work through since the 3.2 upgrade. @kmccormick found that in the meantime you can hide them by editing setup.cfg (might be a different file in other repos) under the [tool:pytest] block and appending to filterwarnings:

filterwarnings=
    ...
    ignore::django.utils.deprecation.RemovedInDjango40Warning
    ignore::django.utils.deprecation.RemovedInDjango41Warning
3 Likes

See also test: suppress Django deprecation warnings during tests by nedbat · Pull Request #29528 · edx/edx-platform · GitHub, a PR which implements this. Apparently there were a couple of other places to copy those lines.

1 Like

Thank you for sharing it.