Daniel Hahler
5d9d12a6be
pytester: improve/fix kwargs validation
2019-04-10 21:57:45 +02:00
Daniel Hahler
ec46864922
run: pass through stdin, just close then
2019-04-10 00:02:38 +02:00
Daniel Hahler
c36a90531a
Move CLOSE_STDIN to class
2019-04-10 00:01:15 +02:00
Daniel Hahler
4fca86e2af
testdir.popen: use kwargs with defaults for stdout/stderr
2019-04-06 12:13:48 +02:00
Daniel Hahler
9ad00714ba
pytester: allow passing in stdin to run/popen
2019-04-06 12:13:28 +02:00
Daniel Hahler
8907fedc79
Merge master into features (with regen branch)
2019-04-03 22:11:00 +02:00
Daniel Hahler
d91527599a
pytester: use monkeypatch with Testdir
2019-04-03 15:02:53 +02:00
Zac-HD
ba1fc02a9b
Register mark used by pytester
2019-03-31 14:22:30 +11:00
Daniel Hahler
4e931b258d
Merge master into features
2019-03-29 11:05:46 +01:00
Daniel Hahler
d17ea7a9c0
tests: ensure cleanup with configs via get_config()
...
Also done in test_pluginmanager, although no resource warnings are
there at least.
Fixes https://github.com/pytest-dev/pytest/issues/4355 .
2019-03-28 00:14:13 +01:00
Daniel Hahler
56dc01ffe0
minor: revisit _possibly_invalidate_import_caches
2019-03-22 17:02:26 +01:00
Daniel Hahler
5df45f5b27
Use fixup_namespace_packages also with pytester.syspathinsert
2019-03-22 17:02:26 +01:00
Daniel Hahler
a50b92ea67
pytester: set HOME only with inline_run/popen
...
Ref: https://github.com/pytest-dev/pytest/issues/4955
2019-03-20 01:15:51 +01:00
Daniel Hahler
c75dd10671
pytester: testdir: set $HOME to tmpdir
...
This avoids loading user configuration, which might interfere with test
results, e.g. a `~/.pdbrc.py` with pdb++.
Also sets USERPROFILE, which will be required with Python 3.8 [1].
1: https://bugs.python.org/issue36264
2019-03-18 20:55:39 +01:00
Daniel Hahler
5e27ea5528
pytester: LineMatcher: assert Sequence when matching in order
...
This can be helpful when passing a set accidentally.
2019-03-15 23:07:08 +01:00
Daniel Hahler
7afe17740f
Merge master into features
2019-03-15 00:52:12 +01:00
Stephan Hoyer
dc7ae41f33
Fix broken error message in pytester
2019-03-08 09:22:00 -08:00
Daniel Hahler
c86d2daf81
pytester: remove unused anypython fixture
...
This became unused after ab9f6a75
(in 2009).
2019-03-06 17:42:21 +01:00
Daniel Hahler
db5cc35b44
pytester: unset PYTEST_ADDOPTS
2019-03-01 18:43:17 +01:00
Daniel Hahler
7b91952645
Merge master into features
...
Conflicts:
tox.ini
2019-02-13 17:58:16 +01:00
Daniel Hahler
237f690f8b
--lsof: suppress stderr
...
This can spam a lot of warnings (per invocation), e.g.:
> lsof: WARNING: can't stat() nsfs file system /run/docker/netns/default
Output information may be incomplete.
Or from Travis/MacOS:
> lsof: WARNING: can't stat() vmhgfs file system /Volumes/VMware Shared Folders
> Output information may be incomplete.
> assuming "dev=31000003" from mount table
2019-02-11 14:08:44 +01:00
Daniel Hahler
9bcbf552d6
Add __repr__ for RunResult
2019-02-08 23:41:20 +01:00
wim glenn
2d18546870
resolving report.when attribute should be reliable now
2019-01-24 11:12:59 -06:00
Anthony Sottile
92a2c1a9c4
remove and ban py.io.BytesIO, py.process, py.path.local.sysfind
2019-01-21 19:51:16 -08:00
Anthony Sottile
0c6ca0da62
Fix usages of py.io.saferepr
2019-01-20 16:36:23 -08:00
Daniel Hahler
3acfa3abdc
Add Testdir.__str__ to return str(self.tmpdir)
...
I just expected this with `monkeypatch.setenv("PYTHONPATH", str(testdir))`,
wondering why it was not picked up correctly.
`
2018-11-17 13:18:54 +01:00
Daniel Hahler
a6a96469ca
pytester: pop TOX_ENV_DIR from os.environ
...
Closes: https://github.com/pytest-dev/pytest/pull/4378
Fixes: https://github.com/pytest-dev/pytest/issues/4366
2018-11-13 09:02:52 +01:00
Daniel Hahler
feccf532d2
doc: improve runpytest_subprocess
2018-11-09 02:03:44 +01:00
Anthony Sottile
2368fbb63c
Apply reorder-python-imports to all files
2018-10-25 00:01:29 -07:00
Bruno Oliveira
9646a1cd7a
Merge remote-tracking branch 'upstream/master' into merge-master-into-features
2018-10-15 12:55:28 -03:00
Daniel Hahler
ee54fb9a6b
pytester: use EXIT_INTERRUPTED
2018-10-13 17:06:40 +02:00
Ronny Pfannschmidt
94829c391b
make tmpdir env cleanup idempotent
2018-10-11 07:15:09 +02:00
Ronny Pfannschmidt
b82d6f7a0b
pytester: use per test tmproot
2018-10-11 07:15:09 +02:00
Ronny Pfannschmidt
85cc9b8f12
move all the things into _pytest.pathlib
2018-10-11 07:15:08 +02:00
Daniel Hahler
b8fc3e569a
pytester: fix __tracebackhide__ for {re_,fn}match_lines
2018-10-10 19:27:43 +02:00
Kyle Altendorf
ccaec8d360
__tracebackhide__ = True
2018-10-06 21:57:03 -04:00
Kyle Altendorf
4b36f9aa64
Tidy timeout checking
2018-10-05 16:46:24 -04:00
Kyle Altendorf
ed5556bdac
Add to docstrings
2018-10-05 10:02:59 -04:00
Kyle Altendorf
42422a7f62
Throw away arbitrary args to runpytest_subprocess()
2018-10-05 00:30:25 -04:00
Kyle Altendorf
f3a173b736
Revert "Use signal.alarm() for py2 timeout"
...
This reverts commit 900cef6397
.
2018-10-05 00:05:46 -04:00
Kyle Altendorf
5c38a5160d
Slight diff tidy
2018-10-04 23:33:38 -04:00
Kyle Altendorf
dcf9eb0104
Raise an exception on unexpected kwargs
2018-10-04 23:27:01 -04:00
Kyle Altendorf
dd225e1b9d
Tidy getting of timeout from kwargs
2018-10-04 23:15:30 -04:00
Kyle Altendorf
900cef6397
Use signal.alarm() for py2 timeout
2018-10-04 23:11:26 -04:00
Kyle Altendorf
dcd635ba0c
Correct timeout to check every so often
2018-10-04 23:08:57 -04:00
Kyle Altendorf
33f0338eeb
kill and wait for subprocess before raising TimeoutExpired
2018-10-04 22:52:51 -04:00
Kyle Altendorf
d5e5433553
Add descriptive message for timeout
2018-10-04 21:43:41 -04:00
Kyle Altendorf
d2906950ce
monotonic.monotonic() -> time.time()
2018-10-04 21:26:08 -04:00
Bruno Oliveira
fe7050ba00
Fix lint
2018-10-04 18:45:30 -03:00
Kyle Altendorf
870a93c37b
Actually construct TimeoutExpired
2018-10-04 01:02:58 -04:00