Skip to content

Config._checkversion checks installed pytest version #98

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

Closed
pytestbot opened this issue Dec 7, 2011 · 3 comments
Closed

Config._checkversion checks installed pytest version #98

pytestbot opened this issue Dec 7, 2011 · 3 comments
Labels
type: bug problem that needs to be addressed

Comments

@pytestbot
Copy link
Contributor

Originally reported by: Matt Davis (BitBucket: jiffyclub, GitHub: jiffyclub)


When setting minversion = X.X in a setup.cfg or similar the version checking does an absolute import of pytest and checks the version of that module.

With this being the case I can bundle py.test 2.2 with my package (using the --genscript file) and explicitly use that for running my tests, but if I have py.test 2.1 installed elsewhere on my system so that import pytest imports py.test 2.1, it will still fail the minversion test.

It would be preferable for Config._checkversion to check the version of py.test that is actually running, and not the version returned by import pytest.


@pytestbot
Copy link
Contributor Author

Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt):


sounds like a different kind of bug, after a genscript-based pytest is loaded,
there shouldn’t be a way to import a system one the normal way,
figuring the exact semantic issue with pythons import system will be a bit troublesome

@pytestbot
Copy link
Contributor Author

Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt):


ok, after a bit of code-skimming, i think there is need to do a deeper review of pylib/pytest wrt use of apipkg and the genscript entrypoint,

@pytestbot
Copy link
Contributor Author

Original comment by Matt Davis (BitBucket: jiffyclub, GitHub: jiffyclub):


I've been playing around with this a bit more and the problem actually appears to be caused by our usage. When I isolate the genscript the minversion check does work as it should. Sorry for the false alarm.

@pytestbot pytestbot added the type: bug problem that needs to be addressed label Jun 15, 2015
mgorny pushed a commit to mgorny/pytest that referenced this issue May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug problem that needs to be addressed
Projects
None yet
Development

No branches or pull requests

1 participant