Commit Graph

1717 Commits

Author SHA1 Message Date
Bruno Oliveira bd343ef757 Merge remote-tracking branch 'upstream/features' into integrate-pytest-warnings 2016-11-22 14:35:39 -02:00
Bruno Oliveira 5ce551e469 Merge pull request #2075 from pytest-dev/master
Merge master into features after fixing flake8 errors
2016-11-22 14:10:31 -02:00
Ronny Pfannschmidt a3319ffe80 Merge pull request #2071 from nicoddemus/fix-flake8
Fix flake8 E305 and E306 errors
2016-11-22 13:22:11 +01:00
Ned Batchelder 632c4d5daf Remove an accidental double space 2016-11-21 10:17:23 -05:00
Bruno Oliveira 26ca5a702e Add tests and integrated the original code into the core 2016-11-21 08:26:43 -02:00
Bruno Oliveira 1da1906483 Rename code to _pytest.warnings and delete old files from the repository 2016-11-21 07:38:12 -02:00
Bruno Oliveira 1eb5a690d4 Fix flake8 E305 and E306 errors
These errors started to appear with flake8-3.1.1, while they don't appear with
version 3.1.0 (weird).
2016-11-20 18:59:15 -02:00
Bruno Oliveira 6876ba9ba6 Merge pull request #1995 from mattduck/feat/restructure-assert-truncation
Restructure truncation of assertion messages
2016-11-13 19:07:35 -02:00
Bruno Oliveira efc54b2e56 Merge branch 'master' into merge-master-features 2016-11-11 18:56:53 -02:00
Bruno Oliveira 3e01e83390 Bump version to 3.0.5.dev 2016-11-11 18:20:34 -02:00
Bruno Oliveira ff72db2f1a Version bump to 3.0.4, CHANGELOG, announcement 2016-11-09 19:38:11 -02:00
Bruno Oliveira 1130b9f742 Fix the stubborn test about cyclic references left by pytest.raises
In Python 2, a context manager's __exit__() leaves sys.exc_info with the exception values even when it was supposed
to suppress the exception, so we explicitly call sys.exc_clear() which removes the traceback and allow the object
to be released.

Also updated the test to not depend on the immediate destruction of the object but instead to ensure it is not being
tracked as a cyclic reference.

Fix #1965
2016-11-08 22:20:27 -02:00
Michael Seifert 1e5b21cd61 Fix memory leak with pytest.raises by using weakref 2016-11-08 22:12:23 -02:00
Dan Wandschneider e46e653794 Clean up unittest TestCase objects after tests are complete (#1649).
Fix #1649

Users of unittest style TestCases will create expensive objects
in setUp. We should clean up TestCase instances that are lying
around so that they don't fill up memory.
2016-11-07 18:32:56 -08:00
Manuel Jacob a190ad27f2 Change version to be in normal form according to PEP 440.
The version is changed from 3.0.4.dev to 3.0.4.dev0.  Note that
according to PEP 440 these are considered equivalent, but 3.0.4.dev0 is
the normal form.

This standard was followed when the version was set to 3.0.3.dev0 in
commit ee284ec5, but in commit a87b1c79 the version was set to
3.0.4.dev, leaving the development number implicit again.
2016-11-06 09:00:04 +01:00
Bruno Oliveira 006a901b86 Properly handle exceptions in multiprocessing tasks
Fix #1984
2016-11-03 10:48:43 -02:00
Georgy Dyuldin e2bb4f893b Fix teardown error message in generated xUnit XML
It was "test setup failure" even error happens on test teardown.
2016-11-02 15:50:32 +03:00
Mathieu Clabaut 6f93ffb5d4 Report teardown output on test failure
Until now, teardown stdout/stderr output was not reported upon test failure.
However such output is sometime necessary to understand the failure.

fix #442
2016-10-30 09:52:46 +01:00
Ronny Pfannschmidt e9668d75b8 turn RecordedWarning into a namedtuple
fixes #2013
2016-10-24 15:23:53 +02:00
Ronny Pfannschmidt 377e649e61 local merge of #1967 - Change exception raised by capture.DontReadFromInput.fileno() 2016-10-24 12:47:55 +02:00
Ronny Pfannschmidt 35d154f580 Merge pull request #2011 from nicoddemus/false-rewrite-warnings
Fix false-positive warnings from assertion rewrite hook
2016-10-24 12:19:23 +02:00
Ronny Pfannschmidt 4e9c633185 Merge pull request #2021 from nicoddemus/doctest-modules-ci
Re-enable docstring testing of _pytest modules on CI
2016-10-24 12:19:05 +02:00
Jason R. Coombs f2c01c5407 Restore pexpect tests and bypass isalive/wait on macOS. Ref #2022. 2016-10-21 12:36:42 -04:00
Bruno Oliveira 37dcdfbc58 Re-enable docstring testing of _pytest modules on CI
* Fix doctests
* List one env per line in tox.ini
* "doctesting" tox env now also tests docstrings using doctest
2016-10-21 08:55:53 -02:00
Bruno Oliveira 9d00615bbf Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2016-10-20 21:51:42 -02:00
Bruno Oliveira 2a2b8cee09 Fix false-positive warnings from assertion rewrite hook
Fix #2005
2016-10-20 21:40:57 -02:00
Bruno Oliveira 620b384b69 Fix cmdline help message for custom options with two or more metavars
Fix #2004
2016-10-20 20:34:39 -02:00
Bruno Oliveira 78eec0d7f8 Handle import errors with non-ascii messages when importing plugins
Fix #1998
2016-10-12 18:19:32 -03:00
Matthew Duck 0061d9bd3d Fix flake8 (unused import, trailng whitespace) 2016-10-11 00:17:15 +01:00
Matthew Duck b629da424e Restructure truncation of assertion messages
This addresses ref https://github.com/pytest-dev/pytest/issues/1954.

The current truncation for assertion explanations does not deal with long lines
properly:

- Previously if lines were too long it would display a "-n more lines"
  message.

- 999e7c6541 introduced a bug where long lines can
  cause index errors if there are < 10 lines.

Extract the truncation logic into its own file and ensure it can deal with
long lines properly.
2016-10-10 23:38:27 +01:00
Bruno Oliveira cf13355d3f Merge pull request #1979 from nicoddemus/show-traceback-during-collection
Show traceback during collection
2016-10-05 16:18:43 -03:00
Tom V c93a9e3361 Fix #1981, improve ini-options help text 2016-10-04 14:41:09 +01:00
Bruno Oliveira a1d446b8e8 Display traceback from Import errors using pytest's short representation
Also omit pytest's own modules and internal libraries (py and pluggy) in low verbosity

Fix #1976
2016-10-03 21:46:44 -03:00
Bruno Oliveira 7d66e4eae1 Display full traceback from Import errors when collecting test modules
Fix #1976
2016-10-03 20:47:44 -03:00
Nikolaus Rath 57bb3c6922 Improve error message when using pytest.skip at module level
As discussed in issue #1959.
2016-10-01 13:38:52 -03:00
Bruno Oliveira 4667b4decc Merge branch 'master' into features 2016-09-29 19:03:26 -03:00
Bruno Oliveira a87b1c79c1 post 3.0.3 release changes 2016-09-29 18:58:17 -03:00
Bruno Oliveira dda17994ec Prepare for 3.0.3 release 2016-09-28 16:33:38 -04:00
Bruno Oliveira 654af0ba25 Merge remote-tracking branch 'upstream/master' into features 2016-09-26 19:32:53 -03:00
Vlad Dragos 3444796f3e Fix formating error. 2016-09-26 13:59:28 +03:00
Vlad Dragos 8985c0be3e Change exception raised by DontReadFromInput.fileno() from ValueError to io.UnsupportedOperation 2016-09-26 13:15:35 +03:00
Bruno Oliveira 835328d862 Vendor pluggy 0.4.0
Fix #1637
2016-09-25 23:36:02 -03:00
Bruno Oliveira 5e96edd435 Merge pull request #1952 from davidszotten/pdbcls_without_pdb_on_fail
Pdbcls without pdb on fail
2016-09-25 20:24:45 -03:00
Roy Williams f1c4cfea2c Remove implementation of `__getslice__`
`__getslice__` has been Deprecated since Python 2.0 and is removed in Python 3.  See
https://docs.python.org/2/reference/datamodel.html#object.__getslice__

Unfortunately, Python 2 will still dispatch to `__getslice__` over `__getitem__`, See
http://bugs.python.org/issue2041, which causes Warnings when running with `-3` in 2.7.
2016-09-23 09:52:30 -07:00
Bruno Oliveira e5deb8a927 Merge pull request #1955 from rowillia/fix_python3_deprecation_warnings
Fix `DeprecationWarnings` found when running py.test in Python 2.7 with the -3 flag.
2016-09-22 17:37:52 -03:00
Roy Williams 24db3c123d Explicitly set to None to have consistent behavior in Python 2 and Python 3 2016-09-22 09:22:12 -07:00
Roy Williams 940ed7e943 Fix `DeprecationWarnings` found when running py.test in Python 2.7 with the -3 flag.
Running through some of my tests with the `-3` flag in python2.7 I encountered some errors within py.test itself.  This fixes those errors so we can use py.test in order to identify problems with Python 3.
2016-09-21 17:44:25 -07:00
Tyler Goodlet 6db2f315fa Explain a bad scope value to the user 2016-09-21 16:40:58 -04:00
David Szotten 0ac85218d1 allow pdbcls without implying usepdb 2016-09-21 09:45:20 +00:00
Lev Maximov 65be1231b1 AttributeError chaining bug #1944 fix 2016-09-20 02:20:13 +07:00