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

General problem with pytest_ignore_collect #132

Closed
blueyed opened this issue Apr 13, 2019 · 4 comments
Closed

General problem with pytest_ignore_collect #132

blueyed opened this issue Apr 13, 2019 · 4 comments

Comments

@blueyed
Copy link
Contributor

blueyed commented Apr 13, 2019

pytest_ignore_collect is used to deselect whole files, but that causes problems currently when -k or -x is used: testmon considers the file as stable later, and would e.g. not run remaining tests that were not run before when using -x, or deselected using -k.

I think files should only be considered stable/updated when no arguments were used maybe?

Given its problems I'd rather not have this feature on by default, i.e. pytest would still visit all files, and only later testmon deselects items.
While it is a nice benefit for projects with many files, it only saves some seconds after all, while causing lots of (annoying) issues.

@blueyed
Copy link
Contributor Author

blueyed commented Apr 15, 2019

I suggest adding an option "testmon_skip_file_collection", defaulting to "auto", which would skip it if -k, -m, or maybe just anything is in config._origargs.
See #136.

@tarpas
Copy link
Owner

tarpas commented May 13, 2019

Ideally testmon would generate the test items from cache instead of importing the python files. I don't use -x or -k very often, and I appreciate the speed that testnom pytest_ingore_collect brings so I'm not sure about your suggestion.

@blueyed wouldn't you take stab at generating the test items, so that they can be filtered afterwards and we would have the advantage or both approaches?

@blueyed
Copy link
Contributor Author

blueyed commented May 13, 2019

IMHO importing/collecting is fast enough, and certainly much less annoying than false results / testmon getting confused.

I do not plan to work on this anytime soon anyway - my current project has fast tests, and my local branch with the different PRs/fixes here works otherwise.. ;)

@tarpas
Copy link
Owner

tarpas commented Dec 5, 2019

This was one of the main goals of the rewrite. However testmon is interrupted or the tests filtered it should keep a consistent database.

@tarpas tarpas closed this as completed Dec 5, 2019
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