Skip to content

Merge master into features #4645

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 28 commits into from
Jan 14, 2019

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Jan 14, 2019

No description provided.

nicoddemus and others added 28 commits January 2, 2019 19:34
…guration-files

Documentation configuration files
…onpath

Mention PYTHONPATH semantics in goodpractices.rst
…ittest

Change test_warningschecker_twice to a unittest
Show full repr with assert a==b and -vv
…tmod-has-call

 Doctest: hack in handling mock style objects
Pytest rewrites assertions so that the items on each
side of a comoparison will have easier-to-read names
in case of an assertion error.

Before doing this, it checks to make sure the object
doesn't have a __name__ attribute; however, it uses
`hasattr` so if the objects __getattr__ is broken then
the test failure message will be the stack trace
for this failure instead of a rewritten assertion.
When rewriting assertions, pytest makes a call to
`__name__` on each object in a comparision. If one of
the objects has reimplemented `__getattr__`, they could
fail trying to fetch `__name__` with an error other than
`AttributeError`, which is what `hasattr` catches.

In this case, the stack trace for the failed `__getattr__`
call will show up in the pytest output, even though
it isn't related to the test failing.

This change fixes that by catching exceptions
that `hasattr` throws.
…with-failing-getattr

Assertion rewrite breaks for objects that reimplement `__getattr__`
Use sphinx removed in extension in the documentation
Use a.item() instead of deprecated np.asscalar(a)
@blueyed blueyed changed the base branch from master to features January 14, 2019 16:16
@codecov
Copy link

codecov bot commented Jan 14, 2019

Codecov Report

Merging #4645 into features will increase coverage by 1.74%.
The diff coverage is 93.02%.

Impacted file tree graph

@@             Coverage Diff              @@
##           features    #4645      +/-   ##
============================================
+ Coverage     93.97%   95.72%   +1.74%     
============================================
  Files           111      111              
  Lines         24603    24686      +83     
  Branches       2437     2448      +11     
============================================
+ Hits          23120    23630     +510     
+ Misses         1161      744     -417     
+ Partials        322      312      -10
Flag Coverage Δ
#docs 29.61% <25.58%> (+0.08%) ⬆️
#doctesting 29.61% <25.58%> (+0.08%) ⬆️
#linting 29.61% <25.58%> (+0.08%) ⬆️
#linux 95.55% <93.02%> (+3.61%) ⬆️
#nobyte 92.33% <82.55%> (?)
#numpy 93.15% <88.37%> (?)
#pexpect 42.08% <29.06%> (?)
#py27 93.73% <82.55%> (+2.89%) ⬆️
#py34 91.83% <84.88%> (+0.74%) ⬆️
#py35 91.86% <86.04%> (+0.75%) ⬆️
#py36 91.88% <86.04%> (+0.75%) ⬆️
#py37 93.89% <88.37%> (+1.73%) ⬆️
#trial 93.15% <88.37%> (?)
#windows 93.91% <93.02%> (+0.49%) ⬆️
#xdist 93.75% <88.37%> (-0.01%) ⬇️
Impacted Files Coverage Δ
testing/test_warnings.py 98.86% <100%> (+0.01%) ⬆️
src/_pytest/python_api.py 97.48% <100%> (+10.04%) ⬆️
src/_pytest/assertion/util.py 97.63% <100%> (+0.09%) ⬆️
testing/test_assertion.py 97.59% <100%> (+0.08%) ⬆️
testing/test_doctest.py 100% <100%> (ø) ⬆️
src/_pytest/assertion/rewrite.py 95.46% <66.66%> (-0.13%) ⬇️
testing/test_assertrewrite.py 83.5% <85.71%> (+0.04%) ⬆️
src/_pytest/doctest.py 96.37% <91.66%> (+1.91%) ⬆️
src/_pytest/cacheprovider.py 95.75% <0%> (-1.42%) ⬇️
testing/code/test_code.py 94.2% <0%> (-1.32%) ⬇️
... and 16 more

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 5bb0be1...1a358df. Read the comment docs.

@asottile asottile merged commit 4947eb8 into pytest-dev:features Jan 14, 2019
@blueyed blueyed deleted the merge-master-into-features branch January 15, 2019 00:33
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.

6 participants