Support modern pytest and pytest-django #5
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support for
pytest-django
versions3.3.0
though3.4.5
(the most recent available as of 1/23/19) and forpytest
versions3.6.0
through4.1.1
(the most recent available as of 1/23/19).It is backwards compatible.
I had to adjust the way the package requirements are specified, because
pytest-django==3.3
dropped support forpytest<3.6
, and it was proving very easy to get into a situation where incompatible versions ofpytest
andpytest-django
were installed, especially when paired with the Travis cache. For example:requirements.txt
specifiedpytest==3.0.4
setup.py
specifiedpytest-django
without a version, which resolved to the latest,3.4.5
, which requirespytest>=3.6.0
.pytest<3.6.0
(so long aspytest-django<3.3.0
is installed) and withpytest>=3.6.0
(so long aspytest-django>=3.3.0
is installed).By removing
pytest
from requirements.txt, everything just works. If a user ofpytest-django-ordering
haspytest-django
pinned to an old version (or, for testing purposes, if we pin it to an old version insetup.py
), then pip will install an old, compatible version ofpytest
. Otherwise, it installs more recent, also mutually-compatible versions.I tested with a variety of combinations, including:
pytest-django==3.2.1
paired withpytest==3.0.6
pytest-django==3.2.1
paired withpytest==3.5.1
pytest-django==3.30
paired withpytest==3.6.0
pytest-django==3.4.5
paired withpytest==4.1.1
Closes #3 and #4