Skip to content
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

Multiple calls to the pytest.main API gives you the same results #793

Closed
joeyespo opened this issue Jun 21, 2015 · 2 comments
Closed

Multiple calls to the pytest.main API gives you the same results #793

joeyespo opened this issue Jun 21, 2015 · 2 comments

Comments

@joeyespo
Copy link

I'm using pytest.main in a plugin. It runs tests and uses Watchdog to listen for file changes. When a file changes, it runs pytest.main again.

Pytest seems to be using a cached version of the tests instead of re-running them with new results.

@hpk42
Copy link
Contributor

hpk42 commented Jun 22, 2015

pytest makes not attempt to unload the test and packaging modules which were imported during the test run. It could probably do that, maybe there is a plugin already doing this. But i usually consider it better for isolation to run tests in a subprocess which is what "pytest-xdist" is doing in its "loop-on-failure" mode.

@hpk42 hpk42 closed this as completed Jun 22, 2015
@joeyespo
Copy link
Author

Ok. Thank you, @hpk42 !

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

No branches or pull requests

2 participants