pytest2/_pytest
Bruno Oliveira 82785fcd40 Use warnings.catch_warnings instead of WarningsRecorder
This has the benefical side-effect of not calling the original
warnings.showwarnings function, which in its original form
only writes the formatted warning to sys.stdout.

Calling the original warnings.showwarnings has the effect that nested WarningsRecorder all catch the warnings:

with WarningsRecorder() as rec1:
    with WarningsRecorder() as rec2:
        warnings.warn(UserWarning, 'some warning')

(both rec1 and rec2 sees the warning)

When running tests with `testdir`, the main pytest session would then see the warnings created by
the internal code being tested (if any), and the main pytest session would end up with warnings as well.
2017-02-18 13:08:14 -02:00
..
_code Remove unused import 2016-11-30 22:34:02 -02:00
assertion Refactored old style classes to new style classes 2017-01-08 22:52:42 -06:00
vendored_packages New-style classes implemented for python 2.7 - #2147 2017-02-16 20:28:17 +01:00
__init__.py bump version to next dev 2017-01-22 22:21:08 +01:00
_argcomplete.py Refactored old style classes to new style classes 2017-01-08 22:52:42 -06:00
_pluggy.py Create `_pytest.vendored_packages` and _pytest._pluggy 2015-09-07 13:01:54 -03:00
cacheprovider.py Refactored old style classes to new style classes 2017-01-08 22:52:42 -06:00
capture.py Refactored old style classes to new style classes 2017-01-08 22:52:42 -06:00
compat.py get_real_func: use saferepr when formatting the error message 2017-01-19 13:05:58 +01:00
config.py Merge branch 'features' into integrate-pytest-warnings 2017-02-18 11:03:15 -02:00
debugging.py Refactored old style classes to new style classes 2017-01-08 22:52:42 -06:00
deprecated.py Merge pull request #1813 from nicoddemus/pytest-setup.cfg 2016-08-17 20:33:57 +02:00
doctest.py Changed the doctest_encoding option to an ini option. 2016-11-30 11:43:33 +01:00
fixtures.py Refactored old style classes to new style classes 2017-01-08 22:52:42 -06:00
freeze_support.py Move the freezing function from genscript.py to a new module freeze_support.py 2016-06-26 19:37:24 +02:00
helpconfig.py Add warning for incorrect passing args to `-o`. 2016-12-01 13:20:42 +01:00
hookspec.py updates for PR review #2198 2017-01-21 16:47:49 +13:00
impl - enhance ordering of tests using parametrized resources 2012-08-01 09:07:32 +02:00
junitxml.py Merge branch 'master' into merge-master-into-features 2016-12-27 23:31:26 -02:00
main.py Add venv to the default norecursedirs 2017-02-15 14:55:12 +01:00
mark.py Refactored old style classes to new style classes 2017-01-08 22:52:42 -06:00
monkeypatch.py merge master into features 2017-01-26 12:00:52 +01:00
nose.py adapt to pluggy naming, rename pytest.hookspec_opts to pytest.hookspec,s ame with hookimpl_opts 2015-05-06 10:08:08 +02:00
pastebin.py Fix flake8 E305 and E306 errors 2016-11-20 18:59:15 -02:00
pytester.py merge master into features 2017-01-26 12:00:52 +01:00
python.py allow error message matching in pytest.raises 2017-02-02 19:52:33 +01:00
recwarn.py Simplify condition 2017-01-03 10:57:19 -02:00
resultlog.py Deprecate --resultlog cmdline option 2016-08-16 21:40:34 -03:00
runner.py Refactored old style classes to new style classes 2017-01-08 22:52:42 -06:00
setuponly.py minor: fix grammar with help for --setup-{only,show} 2016-11-28 21:33:15 +01:00
setupplan.py Fix PEP-8. 2016-07-03 22:33:21 +02:00
skipping.py merge master into features 2017-01-26 12:00:52 +01:00
terminal.py Refactored old style classes to new style classes 2017-01-08 22:52:42 -06:00
tmpdir.py Refactored old style classes to new style classes 2017-01-08 22:52:42 -06:00
unittest.py Fix flake8 E305 and E306 errors 2016-11-20 18:59:15 -02:00
warnings.py Use warnings.catch_warnings instead of WarningsRecorder 2017-02-18 13:08:14 -02:00