Commit Graph

62 Commits

Author SHA1 Message Date
David Szotten 983d249680 reset capture even if readouterr throws
otherwise that exception (and all following output) end up in /dev/null
2015-07-26 01:15:51 +02:00
holger krekel db5649ec6a streamline pytester API majorly:
- integrate conftest into pytester plugin
- introduce runpytest() to either call runpytest_inline (default) or
  runpytest_subprocess (python -m pytest)
- move testdir.inline_runsource1 to pdb tests
- strike some unneccessary methods.
- a new section "writing plugins" and some better pytester docs

--HG--
branch : testrefactor
2015-04-28 11:54:53 +02:00
holger krekel a8afba054a - refine lsof checking
- make runpytest() create an inline testing process instead of
  a subprocess one

--HG--
branch : testrefactor
2015-04-28 11:54:46 +02:00
holger krekel c3ca44b46f change links to go to the new pytest-dev bitbucket team's repo location
--HG--
branch : docs_community
2015-02-27 12:27:40 +01:00
David Szotten 35eec99d41 stop leaking file descriptors
tripps --lsof on os x but not on linux. there's possibly a bug in the leak
detector (not investigated here)

--HG--
branch : stop_leaking_fds
2014-09-22 13:56:07 +01:00
David Szotten bc4eecbbac add `encoding` attr to DontReadFromInput
required by https://docs.python.org/2/library/stdtypes.html#file.encoding

and used e.g. by ipdb at _import_ time

--HG--
branch : dontreadfrominput-encoding
2014-09-22 12:19:27 +01:00
Floris Bruynooghe 7d9d502a01 Use py3k compatible .__getattr__() code
From the python-dev thread it seemed like using
object.__getattribute__(self, 'name') is the cleanest way of
implementing a class wich uses .__getattr__() and should be
pickelable.  That only works on new-style classes so this also turns
HookProxy into a new-style class on py2.

This also re-writes the test to not use cPickle so it runs on py3k.
2014-09-05 23:55:14 +01:00
uweschmitt d1bde69c1e added smoke test for bug fixed in 3716:dc080608b6d1 2014-08-19 12:57:37 +02:00
holger krekel 1d7b574b31 fix issue555: just add "errors" attribute to internal Capture stream. 2014-08-07 11:05:42 +02:00
holger krekel 1265612465 fix issue547 2.6 regression: capsys/capfd now work again when output capturing ("-s") is disabled. 2014-07-28 13:17:37 +02:00
holger krekel 54c88a6cf3 fix flakes issues 2014-06-16 11:27:32 +02:00
holger krekel e6859406f1 fix test on py33, thanks msabramo1 2014-04-02 20:49:57 +02:00
holger krekel 68e58e1493 add a test for robustness of capturing when a test closes FD1/2 2014-04-02 20:29:10 +02:00
Marc Abramowitz 2c0f6207e9 test_capture.py: More PEP8. Remove unused `cap` in `with`.
--HG--
branch : remove_unused_import
2014-04-02 09:48:08 -07:00
Marc Abramowitz 02d94e69f0 testing/test_capture.py: Remove unused `import tempfile`
--HG--
branch : remove_unused_import
2014-04-02 09:14:16 -07:00
holger krekel 0c04b44919 fix issue492: avoid leak in test_writeorg 2014-04-02 12:32:21 +02:00
holger krekel 21b4280126 Merged in msabramo/pytest/test_writeorg_close_tempfile (pull request #136)
test_writeorg: Close a tempfile
2014-04-02 09:30:55 +02:00
holger krekel ce8678e6d5 remove non-documented per-conftest capturing option and simplify/refactor all code accordingly. Also make capturing more robust against tests closing FD1/2 and against pdb.set_trace() calls. 2014-04-01 14:32:12 +02:00
holger krekel ca5e6830c6 avoid some redundancy by using SysCapture from FDCapture for manipulating sys.std{out,in,err} 2014-04-01 14:19:55 +02:00
holger krekel 69cbac8fb5 rename StdCaptureBase to MultiCapture 2014-04-01 14:19:52 +02:00
Marc Abramowitz 7301981f32 test_writeorg: Close a tempfile
--HG--
branch : test_writeorg_close_tempfile
2014-03-31 08:25:35 -07:00
holger krekel 9d716a39d6 fix issue412 and other encoding issues. Streamline dupfile() into
a new more thoughtful safe_text_dupfile helper.
2014-03-28 11:27:02 +01:00
holger krekel 923dcfd620 cleanup and refine issue412 test (still failing on py33) 2014-03-28 09:46:38 +01:00
holger krekel b5467645d3 merge 2014-03-28 09:27:44 +01:00
holger krekel 0b340aa1f6 simplify some capturing tests 2014-03-28 07:55:07 +01:00
holger krekel a8f4f49a82 simplify reset/stop_capturing and fix capturing wrt to capturing simple os.write() calls 2014-03-28 07:11:25 +01:00
holger krekel e18c3ed494 unify and normalize Sys/FD Capturing classes
* * *
more unification
2014-03-28 07:03:37 +01:00
holger krekel 2263fcf6b7 remove unused "suspend/resume" on capturing, some formatting cleanup 2014-03-28 07:03:34 +01:00
Ronny Pfannschmidt 2b2c1e5b7b condition for python3 of the xfailing test for 412 2014-03-27 14:01:38 +01:00
holger krekel 7b63fa5966 merge in current default 2014-03-27 13:57:54 +01:00
Ronny Pfannschmidt b18040337a xfailing test for issue 412 2014-03-27 13:53:59 +01:00
holger krekel 9777703e03 - turn on capturing before early conftest loading and make terminal writer
use the original stream.

- avoid resetting capture FDs/sys.stdout for each test by keeping capturing
  always turned on and looking at snapshotted capturing data during runtest
  and collection phases.
2014-03-14 12:49:36 +01:00
holger krekel b47fdbe0a7 remove externally setting and dealing with "item.outerr" from capturing in favor of a direct interface for adding reporting sections to items.
* * *
refactor makereport implementation to avoid recursion with __multicall__
2014-03-14 12:49:34 +01:00
holger krekel 1830de2c13 make it clear that this xfail is an unimplemented feature, nothing more. 2014-01-29 13:56:24 +01:00
holger krekel 25ab906b8b add release announcement, bump version to 2.5.2,
add links to plugins index, regenerate doc examples.
2014-01-29 13:47:11 +01:00
holger krekel 4eabfed651 refactor lsof checking and fix an lsof leak in pypy 2014-01-29 11:18:15 +01:00
holger krekel 6f385fb4ea remove "mixed" capturing mode which is not used by pytest
--HG--
branch : capsimple1
2014-01-25 19:56:27 +01:00
holger krekel 18e12cbd67 remove "StdCapture*.call" classmethod because pytest does not use it.
--HG--
branch : capsimple1
2014-01-25 19:43:57 +01:00
holger krekel 3cf4e133cc remove now parameter because pytest only used now==False everywhere
--HG--
branch : capsimple1
2014-01-25 19:42:45 +01:00
Ronny Pfannschmidt 177637bfb9 Redo the Capture integration propperly 2014-01-24 21:22:19 +01:00
holger krekel 400b51caf6 mark encoding test as xfail also on py2 2014-01-22 22:18:33 +01:00
holger krekel 9aaf0fd340 backing out Ronny's PR because it was merged too early (still has failing tests) 2014-01-22 22:15:40 +01:00
Ronny Pfannschmidt ac2f2b1deb add notes on the copied pylib version 2014-01-22 21:50:07 +01:00
Ronny Pfannschmidt 0be961a0f3 capture tests: move imports and declarations to the top 2014-01-22 21:46:35 +01:00
Ronny Pfannschmidt 3cc58c2f78 rewrite all testing uses of py.io to _pytest.capture 2014-01-22 19:32:23 +01:00
Ronny Pfannschmidt 0ac94134f5 initial code import for capture transfer 2014-01-22 19:04:38 +01:00
Ronny Pfannschmidt c142f2551d xfailing test for captire encoding issues with binary stdio 2014-01-22 18:07:54 +01:00
holger krekel 2700a94d49 remove an old duplicate marker and use recent pytest mechanism for parametrization 2013-11-21 14:40:14 +01:00
holger krekel 2c7d00579b bump version, some windows test fixes, prevent logging from raising exceptions at the end (finally), add py25 to tox.ini. 2013-09-30 16:09:26 +02:00
holger krekel db6f347db6 fix issue358 -- introduce new pytest_load_initial_conftests hook and make capturing initialization use it, relying on a new (somewhat internal) parser.parse_known_args() method.
This also addresses issue359 -- plugins like pytest-django could implement a pytest_load_initial_conftests hook like the capture plugin.
2013-09-30 13:14:16 +02:00