Skip to content

Add pytest-custom_exit_code #6648

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 2 commits into from
Feb 18, 2020
Merged

Add pytest-custom_exit_code #6648

merged 2 commits into from
Feb 18, 2020

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Feb 12, 2020

This is to allow us to ignore the exit code from pytest when
no tests were collected, when using the -k option, for example.

This is to allow us to ignore the exit code from pytest when
no tests were collected, when using the -k option, for example.
@stsewd stsewd requested a review from humitos February 12, 2020 15:49
@humitos
Copy link
Member

humitos commented Feb 13, 2020

Why do we need this in community repository? Failing when no test are collected makes sense to me.

Although, I think we need this in commercial instead, where we want to run a test from readthedocsinc but the whole suite fails because it tries to find it in community first and it doesn't find it.

@humitos
Copy link
Member

humitos commented Feb 13, 2020

We can move the dependency to corporate under setup.py:options.extras_require.tests.

@stsewd
Copy link
Member Author

stsewd commented Feb 13, 2020

@humitos I'm planning to run the test suite with different settings files here as well (#6623), so this is needed here too.

@stsewd
Copy link
Member Author

stsewd commented Feb 13, 2020

the whole suite fails because it tries to find it in community first and it doesn't find it.

It failed because the test you wanted to run (sso related) was only run when using another settings file

@humitos
Copy link
Member

humitos commented Feb 17, 2020

Hrm... I see your point. I'd like to have a way to use this plugin only when running tests locally, but when running in CI we force a good exit code. Otherwise, we will see the Green bullet and think that everything was OK, when all test could be failing completely. Is it possible to use this only locally?

@stsewd
Copy link
Member Author

stsewd commented Feb 17, 2020

Otherwise, we will see the Green bullet and think that everything was OK, when all test could be failing completely

The plugin only overrides the exit code for "no tests were collected" (5). https://docs.pytest.org/en/latest/usage.html

@stsewd stsewd merged commit 47622bd into master Feb 18, 2020
@stsewd stsewd deleted the ignore-pytest-no-tests-collected branch February 18, 2020 14:26
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.

2 participants