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

Doctest: hack in handling mock style objects #4212

Merged

Conversation

RonnyPfannschmidt
Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt commented Oct 22, 2018

Resolves #3456

@nicoddemus
Copy link
Member

Just FYI: GitHub is facing some issues so webhooks are disabled for the moment: https://status.github.com/messages

@RonnyPfannschmidt
Copy link
Member Author

i am aware ^^

@codecov
Copy link

codecov bot commented Oct 22, 2018

Codecov Report

Merging #4212 into master will increase coverage by 0.02%.
The diff coverage is 93.1%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4212      +/-   ##
==========================================
+ Coverage   95.73%   95.75%   +0.02%     
==========================================
  Files         111      111              
  Lines       24686    24947     +261     
  Branches     2446     2503      +57     
==========================================
+ Hits        23632    23887     +255     
- Misses        741      748       +7     
+ Partials      313      312       -1
Flag Coverage Δ
#docs 29.62% <68.96%> (+0.13%) ⬆️
#doctesting 29.62% <68.96%> (+0.13%) ⬆️
#linting 29.62% <68.96%> (+0.13%) ⬆️
#linux 95.57% <93.1%> (+0.02%) ⬆️
#nobyte 92.43% <62.06%> (+0.05%) ⬆️
#numpy 92.45% <86.2%> (-0.72%) ⬇️
#pexpect 42.15% <68.96%> (+0.05%) ⬆️
#py27 93.82% <62.06%> (+0.06%) ⬆️
#py34 91.92% <75.86%> (+0.11%) ⬆️
#py35 91.88% <79.31%> (+0.04%) ⬆️
#py36 91.89% <79.31%> (+0.04%) ⬆️
#py37 93.09% <79.31%> (-0.82%) ⬇️
#trial 92.45% <86.2%> (-0.72%) ⬇️
#windows 93.95% <93.1%> (+0.02%) ⬆️
#xdist 93.78% <86.2%> (-0.01%) ⬇️
Impacted Files Coverage Δ
testing/test_doctest.py 100% <100%> (ø) ⬆️
src/_pytest/doctest.py 96.37% <91.66%> (-0.47%) ⬇️
src/_pytest/assertion/util.py 96.96% <0%> (-0.58%) ⬇️
testing/test_assertion.py 97.29% <0%> (-0.22%) ⬇️
src/_pytest/terminal.py 91.76% <0%> (+0.84%) ⬆️

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 2359663...a6988aa. Read the comment docs.

@RonnyPfannschmidt RonnyPfannschmidt changed the title [WIP] Doctest: hack in handling mock style objects Doctest: hack in handling mock style objects Jan 10, 2019
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.

Clever solution, awesome!

Please just add a docstring to _is_mocked and _patch_unwrap_mock_aware explaining what's going on to the unaware, including a reference to the issue. 🙇

@nicoddemus
Copy link
Member

great, thanks

@nicoddemus nicoddemus merged commit 5f16ff3 into pytest-dev:master Jan 10, 2019
@RonnyPfannschmidt RonnyPfannschmidt deleted the doctest-testmod-has-call branch January 20, 2019 13:12
@twmr
Copy link
Contributor

twmr commented May 24, 2019

@RonnyPfannschmidt Thx for this hack! I have applied it in pytest-sphinx as well.

@RonnyPfannschmidt
Copy link
Member Author

@Thisch im glad it could help, i was repulsed as i made it ^^

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.

--doctest-modules causes py.test to consume all memory and then crash
3 participants