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

Permit warnings in *_stale_pyc tests #190

Merged
merged 2 commits into from Jun 4, 2020
Merged

Conversation

mgorny
Copy link
Contributor

@mgorny mgorny commented May 26, 2020

The *_stale_pyc test is repeatedly failing on production systems
due to additional pytest plugins being installed and triggering
PytestAssertRewriteWarnings. This causes 'passed ' string not to match
because of the ',' after 'passed'. Match just 'passed
' instead
to solve this.

The *_stale_pyc test is repeatedly failing on production systems
due to additional pytest plugins being installed and triggering
PytestAssertRewriteWarnings.  This causes 'passed *' string not to match
because of the ',' after 'passed'.  Match just 'passed*' instead
to solve this.
@nicoddemus
Copy link
Member

Hi @mgorny,

Thanks for the patch!

The *_stale_pyc test is repeatedly failing on production systems

Can you explain to me why are you running pytest-mock's tests in your production systems?

The patch is simple of course, but I would like to know your use case better because it makes the tests a bit more fragile: besides warnings changing the message to 1 passed, 2 warnings in X seconds, it might also hide other problems like errors and failures being given such as 1 passed, 1 error in case of teardown failures.

@mgorny
Copy link
Contributor Author

mgorny commented Jun 1, 2020

We are running tests while installing to production systems to make sure that packages will actually work in the production system. As you have probably experienced yourself, there are some Python packages that break in the presence of other packages and testing them in pristine virtualenv doesn't guarantee that the same results will be reproducible in production.

@nicoddemus
Copy link
Member

Thanks @mgorny for context and sorry about the delay.

I've changed that test to use result.assert_outcomes, as that is safer.

@nicoddemus nicoddemus merged commit 5842895 into pytest-dev:master Jun 4, 2020
@nicoddemus
Copy link
Member

Thanks!

@mgorny
Copy link
Contributor Author

mgorny commented Jun 4, 2020

Thank you a lot.

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.

None yet

2 participants