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

Fix num_mock_patch_args to use identity comparison #5607

Closed
wants to merge 1 commit into from

Conversation

nicoddemus
Copy link
Member

Fix #5606

@nicoddemus nicoddemus added the needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch label Jul 15, 2019
@codecov
Copy link

codecov bot commented Jul 15, 2019

Codecov Report

Merging #5607 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5607      +/-   ##
==========================================
+ Coverage   96.11%   96.11%   +<.01%     
==========================================
  Files         117      117              
  Lines       25775    25786      +11     
  Branches     2495     2497       +2     
==========================================
+ Hits        24773    24784      +11     
  Misses        697      697              
  Partials      305      305
Impacted Files Coverage Δ
testing/python/integration.py 93.83% <100%> (+0.26%) ⬆️
src/_pytest/compat.py 97.16% <100%> (+0.1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 54e08b7...4198b62. Read the comment docs.

Copy link
Member

@asottile asottile left a comment

Choose a reason for hiding this comment

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

@@ -67,8 +67,17 @@ def num_mock_patch_args(function):
mock_modules = [sys.modules.get("mock"), sys.modules.get("unittest.mock")]
Copy link
Member

Choose a reason for hiding this comment

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

its a 2 element list, use a variable, and use 2 is checks at the end - its ridiculus to introduce that kind of helper function programming here

Copy link
Member Author

Choose a reason for hiding this comment

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

"ridiculous"

@nicoddemus nicoddemus closed this Jul 16, 2019
@nicoddemus nicoddemus deleted the mock-sentinel-5606 branch July 16, 2019 21:15
RonnyPfannschmidt pushed a commit to RonnyPfannschmidt/pytest that referenced this pull request Jul 19, 2019
RonnyPfannschmidt pushed a commit to RonnyPfannschmidt/pytest that referenced this pull request Jul 20, 2019
@asottile asottile removed the needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch label Oct 13, 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

Successfully merging this pull request may close these issues.

ValueError when collecting tests that patch an array
3 participants