Commit Graph

9642 Commits

Author SHA1 Message Date
Bruno Oliveira 42bb0b3904 Use a.item() instead of deprecated np.asscalar(a)
np.asscalar() has been deprecated in numpy 1.16:

https://github.com/numpy/numpy/blob/master/doc/release/1.16.0-notes.rst#new-deprecations
2019-01-14 08:59:09 -02:00
Bruno Oliveira 1bb463a980
Merge pull request #4642 from nicoddemus/rtd-bot-config
Add rtd-bot configuration file
2019-01-14 05:57:50 -02:00
Anthony Sottile 16546b7342 Remove some dead code
- I wrote a thing: https://github.com/asottile/dead
- wanted to try it out, there's lots of false positives and I didn't look
  through all the things it pointed out but here's some
2019-01-13 20:41:30 -08:00
Bruno Oliveira f2174c16cc Add rtd-bot configuration file [skip appveyor] [skip travis]
Part of the configuration necessary for https://github.com/apps/rtd-helper
2019-01-13 20:38:19 -02:00
Bruno Oliveira e48f68953d
Merge pull request #4638 from nicoddemus/release-4.1.1
Preparing release version 4.1.1
2019-01-12 12:51:32 -02:00
Bruno Oliveira 25081d8e30
Merge pull request #4570 from nicoddemus/sphinx-removed-in
Use sphinx removed in extension in the documentation
2019-01-12 08:34:29 -02:00
Bruno Oliveira 34eeda1c09 Preparing release version 4.1.1 2019-01-12 00:55:12 +00:00
Bruno Oliveira 3efb26ae7f
Merge pull request #4632 from AnjoMan/dont-rewrite-objects-with-failing-getattr
Assertion rewrite breaks for objects that reimplement `__getattr__`
2019-01-11 14:07:22 -02:00
Anton Lodder 77da4f118c Add changelog 4631 and AUTHOR credits for Anton Lodder 2019-01-10 20:48:51 -05:00
Anton Lodder 3241fc3103 Don't fail if hasattr fails when rewriting assertions
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.
2019-01-10 20:45:15 -05:00
Anton Lodder acb3e8e8a7 Test rewriting assertion when __name__ fails
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.
2019-01-10 20:45:15 -05:00
Bruno Oliveira 5f16ff3acc
Merge pull request #4212 from RonnyPfannschmidt/doctest-testmod-has-call
Doctest: hack in handling mock style objects
2019-01-10 19:13:45 -02:00
Bruno Oliveira 71a745270a
Merge pull request #4607 from oscarbenjamin/long_output
Show full repr with assert a==b and -vv
2019-01-10 12:30:46 -02:00
Bruno Oliveira 5dcb370f78
Merge pull request #4624 from nicoddemus/merge-master-into-features
Merge master into features
2019-01-10 12:11:20 -02:00
Bruno Oliveira 0f918b1a9d xunit-style functions and methods are invoked by autouse fixtures
Fix #3094, Fix #517
2019-01-10 12:10:04 -02:00
Ronny Pfannschmidt a6988aa0b9 fix doctest module when a mock object is around
fixes #3456
2019-01-10 12:50:22 +01:00
Bruno Oliveira 2359663437
Merge pull request #4622 from nicoddemus/warningschecker-unittest
Change test_warningschecker_twice to a unittest
2019-01-10 06:04:25 -02:00
Anthony Sottile bace28517e
Merge pull request #4626 from nicoddemus/goodpractices-pythonpath
Mention PYTHONPATH semantics in goodpractices.rst
2019-01-09 20:41:53 -08:00
Bruno Oliveira 9f6d9efc1d Mention PYTHONPATH semantics in goodpractices.rst
Fix #4625
2019-01-09 22:45:09 -02:00
Bruno Oliveira a0ab5a7cd8
Merge pull request #4609 from yoavcaspi/documentation-configuration-files
Documentation configuration files
2019-01-09 22:32:02 -02:00
Bruno Oliveira ba8b3be61a
Improve CHANGELOG 2019-01-09 20:27:18 -02:00
Yoav Caspi 2467831913 rephrase warning section to explain better the issue. 2019-01-09 23:52:08 +02:00
Bruno Oliveira e4a21b11d5 Change test_warningschecker_twice to a unittest 2019-01-09 18:58:51 -02:00
Daniel Hahler f3b6425324
Merge pull request #4620 from Sup3rGeo/bugfix/warningschecker-twice
Bugfix/warningschecker twice
2019-01-09 15:36:29 +01:00
Daniel Hahler 7ee03e0996
Punctuation [ci skip] 2019-01-09 15:35:52 +01:00
Victor Maryama 081accb62c Fixed linting in changelog. 2019-01-09 13:11:22 +01:00
Victor Maryama fe4835c15e Added changelog entry. 2019-01-09 12:55:15 +01:00
Victor Maryama df3b5557d1 Reseting entered state in WarningsRecorder (fixes 4617) 2019-01-09 12:51:04 +01:00
Victor Maryama 948a5d5ac6 Added test for Issue 4617 2019-01-09 12:31:26 +01:00
Oscar Benjamin 85055a9efe Show full repr with assert a==b and -vv 2019-01-08 01:25:05 +00:00
Yoav Caspi 149620f858 update changelog 2019-01-06 23:11:27 +02:00
Yoav Caspi 6ee5d431a0 add warning for using non canonical configuration files. 2019-01-06 23:11:24 +02:00
Anthony Sottile a4c426b1a8
Merge pull request #4604 from asottile/uninstall_hypothesis
Uninstall hypothesis in regen tox env
2019-01-06 10:28:11 -08:00
Anthony Sottile 4f38c610c3 Uninstall hypothesis in regen tox env 2019-01-06 07:53:39 -08:00
Bruno Oliveira 38adb23bd2
Merge pull request #4600 from nicoddemus/release-4.1.0
Release 4.1.0
2019-01-06 13:09:11 -02:00
Bruno Oliveira e24031fb36 Regendocs again, without hypothesis 2019-01-05 20:42:44 +00:00
Bruno Oliveira 99ef8c6d16 Fix typo in Makefile: PYTEST_ADDOPT -> PYTEST_ADDOPTS 2019-01-05 20:31:01 +00:00
Bruno Oliveira e8152207c4
Merge pull request #4601 from Stranger6667/fix-typo
Fix typo in the Changelog for `get_closest_marker`
2019-01-05 18:25:50 -02:00
Bruno Oliveira d7465895d0 Regendoc again 2019-01-05 19:19:40 +00:00
dmitry.dygalo 5d0bcb4419
Fix typo in the Changelog for `get_closest_marker` 2019-01-05 20:08:09 +01:00
Bruno Oliveira 01151ff566 Add example for -ra usage to the docs 2019-01-05 16:53:12 -02:00
Bruno Oliveira d0e9b4812f Regendocs 2019-01-05 16:38:59 -02:00
Bruno Oliveira 5a8e674e92 Add dataclasses as a regendoc dependency 2019-01-05 16:38:59 -02:00
Bruno Oliveira e380d4306b Anonimize attrs links 2019-01-05 16:38:59 -02:00
Bruno Oliveira 9d297c06e8 Preparing release version 4.1.0 2019-01-05 16:38:59 -02:00
Anthony Sottile e24fdb138d
Merge pull request #4598 from nicoddemus/license-year
Update copyright year
2019-01-05 09:09:55 -08:00
Bruno Oliveira 0da5531c7c
Merge pull request #4599 from s0undt3ch/feature/skiporfail-reason
Custom reason support for "importorskip"
2019-01-05 13:15:17 -02:00
Bruno Oliveira 0c4898670c Add changelog entry and update docs for importorskip 2019-01-05 12:55:39 -02:00
Pedro Algarvio be7eb22e88
Add test case for `importorskip` custom reason 2019-01-04 19:06:23 +00:00
Pedro Algarvio 8b48621687
Allow providing a custom reason for `importorskip` 2019-01-04 18:05:28 +00:00