Commit Graph

9466 Commits

Author SHA1 Message Date
Bruno Oliveira eb92e57509 Show deprecation message when running under Python 2.7 and 3.4
Fix #4627
2019-01-29 19:02:41 -02:00
Bruno Oliveira 6aba60ab08
Merge pull request #4688 from nicoddemus/add-config-to-hooks
Add config to pytest_report_teststatus
2019-01-28 21:45:58 -02:00
Bruno Oliveira d720312df0 Add CHANGELOG entry for #4688 2019-01-28 19:03:19 -02:00
Bruno Oliveira 5b09eb1d74 Add config parameter to pytest_report_teststatus hook 2019-01-28 19:00:50 -02:00
Bruno Oliveira 9905a73ae0
Merge pull request #4511 from jhunkeler/junit-strict
Toggle JUnit behavior with INI option
2019-01-24 20:54:32 -02:00
Bruno Oliveira 51dd738b1a
Merge pull request #4673 from kown7/count-tests
Count tests
2019-01-24 20:46:29 -02:00
Kristoffer Nordstroem e2cd2cd409 vanity commit 2019-01-24 23:18:21 +01:00
Bruno Oliveira 37aab5dd6b Add CHANGELOG entry for #4660 2019-01-24 20:07:21 -02:00
Kristoffer Nordstroem 6d38868950 fix tests by adding additional output to expected responses 2019-01-24 00:08:43 +01:00
Kristoffer Nordstroem 8723eb16ea only print selected if any have been selected 2019-01-24 00:00:29 +01:00
Bruno Oliveira daf39112e7
Merge pull request #4091 from nicoddemus/setup-methods-as-fixtures-3094
Use fixtures to invoke xunit-style fixtures
2019-01-23 19:23:31 -02:00
Kristoffer Nordstroem 9f86e83478 count selected tests 2019-01-21 23:56:39 +01:00
Joseph Hunkeler 85c5fa9f64
Update changelog 2019-01-14 22:58:41 -05:00
Joseph Hunkeler 8967976443
Ensure xml object is viable before testing family type 2019-01-14 22:58:41 -05:00
Joseph Hunkeler bcacc40775
Update comment text 2019-01-14 22:58:41 -05:00
Joseph Hunkeler 4ecf29380a
Adds xunit2 version of test_record_attribute 2019-01-14 22:58:41 -05:00
Joseph Hunkeler aaa7d36bc9
Change family behavior:
* "legacy" is no longer a copy of "xunit1"
* Attempts to use "legacy" will redirect to "xunit1"
* record_xml_attribute is not compatible outside of legacy family
* Replace call to method/override raw() with to_xml()
2019-01-14 22:58:40 -05:00
Joseph Hunkeler 8937e39afd
Raise TypeError instead of NotImplementedError if not list type 2019-01-14 22:58:40 -05:00
Joseph Hunkeler 343430c537
Replace family "old" with "legacy" 2019-01-14 22:58:40 -05:00
Joseph Hunkeler 335cc5d651
Handle backwards-compatiblity 2019-01-14 22:58:40 -05:00
Joseph Hunkeler 2e551c32b6
Add junit_family config option 2019-01-14 22:58:40 -05:00
Joseph Hunkeler af2ee1e80a
Emit JUnit compatible XML
* Remove non-standard testcase elements: 'file' and 'line'
* Replace testcase element 'skips' with 'skipped'
* Time resolution uses the standard format: 0.000
* Tests use corrected XML output with proper attributes
2019-01-14 22:58:40 -05:00
Anthony Sottile 4947eb85c0
Merge pull request #4645 from blueyed/merge-master-into-features
Merge master into features
2019-01-14 14:41:27 -08:00
Daniel Hahler 1a358df998 Merge master into features 2019-01-14 17:15:39 +01:00
Anthony Sottile 5903f4596a
Merge pull request #4643 from nicoddemus/asscalar-deprecated
Use a.item() instead of deprecated np.asscalar(a)
2019-01-14 07:36:13 -08:00
Anthony Sottile 5bb0be1e24
Merge pull request #4615 from asottile/some_dead_code
Remove some dead code
2019-01-14 07:35:21 -08:00
Bruno Oliveira 6504746652 Add CHANGELOG entry for #4643 2019-01-14 09:03:23 -02:00
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