Skip to content

Support modern pytest and pytest-django #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 29, 2019

Conversation

rebeccacremona
Copy link
Contributor

This PR adds support for pytest-django versions 3.3.0 though 3.4.5 (the most recent available as of 1/23/19) and for pytest versions 3.6.0 through 4.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 for pytest<3.6, and it was proving very easy to get into a situation where incompatible versions of pytest and pytest-django were installed, especially when paired with the Travis cache. For example:

  • requirements.txt specified pytest==3.0.4
  • setup.py specified pytest-django without a version, which resolved to the latest, 3.4.5, which requires pytest>=3.6.0.
  • tests failed, even though this plugin works perfectly with pytest<3.6.0 (so long as pytest-django<3.3.0 is installed) and with pytest>=3.6.0 (so long as pytest-django>=3.3.0 is installed).

By removing pytest from requirements.txt, everything just works. If a user of pytest-django-ordering has pytest-django pinned to an old version (or, for testing purposes, if we pin it to an old version in setup.py), then pip will install an old, compatible version of pytest. Otherwise, it installs more recent, also mutually-compatible versions.

I tested with a variety of combinations, including:

  • pytest-django==3.2.1 paired with pytest==3.0.6
  • pytest-django==3.2.1 paired with pytest==3.5.1
  • pytest-django==3.30 paired with pytest==3.6.0
  • pytest-django==3.4.5 paired with pytest==4.1.1
  • and I think a few more in between.

Closes #3 and #4

@rlucioni
Copy link
Owner

Thank you @rebeccacremona! I'm sorry for the delay on my end, just got back from a trip. I appreciate both your contribution and the level of detail in your PR description. Changes look good to me. I'll get version 1.1.0 (since the changes are backwards compatible) up on PyPI today.

@rlucioni rlucioni merged commit da6c4cb into rlucioni:master Jan 29, 2019
@rebeccacremona
Copy link
Contributor Author

Awesome! Thanks!

@rlucioni
Copy link
Owner

@rebeccacremona all set! 1.1.0 is available. Thanks again for your help here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pytest 3.6 support
2 participants