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

Ignore erroneous files that don't contain the required test #337

Open
yaelbh opened this issue Nov 21, 2022 · 0 comments
Open

Ignore erroneous files that don't contain the required test #337

yaelbh opened this issue Nov 21, 2022 · 0 comments

Comments

@yaelbh
Copy link

yaelbh commented Nov 21, 2022

Suppose that we have two test files: relevant_tests.py and irrelevant_with_bad_import.py. relevant_tests.py is the only file containing a specific test named test_interesting. In addition, irrelevant_with_bad_import.py contains a bad import.

If I run

stestr run -n relevant_tests.py

then everything's fine.

If I run

stestr run - test_interesting

then I get an error because of the bad import of irrelevant_with_bad_import.py, and no test is executed.

I understand that the reason for the difference is that the latter triggers a discovery mechanism, which inspects all the tests files, including the one with the bad import. Unlike the first example, which from the beginning directs to one specific file.

However, in my opinion, erroneous test files that don't contain the required test should not trigger errors. And, even if yes, this should not prevent the test from running normally in the other, correct test file.

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

1 participant