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

Make YIELD_TEST warning less spammy #2563

Merged
merged 1 commit into from
Jul 13, 2017

Conversation

pv
Copy link
Contributor

@pv pv commented Jul 10, 2017

Emit the yield test deprecation warning only once per generator, rather than for each generated function.

This is important when porting old projects with a large number of legacy yield tests --- you don't want to have the warning repeated 10000+ times in the output.

Addresses #2562 (apart from the fact that these warnings cannot be ignored via filterwarnings)

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks!

Emit it only once per each generator, rather than for each generated
function. Also add information about which test caused it to be emitted.
@pv pv force-pushed the yield-warn-spam branch from 7c17af1 to 8a7d98f Compare July 10, 2017 19:41
@pv
Copy link
Contributor Author

pv commented Jul 10, 2017

Updated it to use self.warn instead of self.config.warn so that also the name of the test is indicated.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 92.138% when pulling 7c17af1 on pv:yield-warn-spam into 7cd03d7 on pytest-dev:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 92.127% when pulling 8a7d98f on pv:yield-warn-spam into 7cd03d7 on pytest-dev:master.

@nicoddemus
Copy link
Member

@RonnyPfannschmidt would you like to take a look or can we merge this?

@pv
Copy link
Contributor Author

pv commented Jul 13, 2017

Thanks! This is a big help (then just patiently waiting for the release...)

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.

4 participants