summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorChristian Boelsen <christian.boelsen@hds.com>2017-09-13 17:14:24 +0100
committerChristian Boelsen <christian.boelsen@hds.com>2017-09-13 17:15:32 +0100
commit14b6380e5f8c2e26aa518de8a499978eb9601848 (patch)
treefbbbb5e8c596c81b0681c7138831aaf586750c4c /testing
parent70cdfaf66107f0b30c33a8dc5232b100ffa8ff0c (diff)
downloadpytest-14b6380e5f8c2e26aa518de8a499978eb9601848.tar.gz
Fix #2775 - running pytest with "--pyargs" will result in Items with empty "parent.nodeid" if run from a different root directory
Diffstat (limited to 'testing')
-rw-r--r--testing/acceptance_test.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py
index 712776906..8a8c32762 100644
--- a/testing/acceptance_test.py
+++ b/testing/acceptance_test.py
@@ -624,8 +624,10 @@ class TestInvocationVariants(object):
for p in search_path:
monkeypatch.syspath_prepend(p)
+ os.chdir('world')
# mixed module and filenames:
- result = testdir.runpytest("--pyargs", "-v", "ns_pkg.hello", "world/ns_pkg")
+ result = testdir.runpytest("--pyargs", "-v", "ns_pkg.hello", "ns_pkg/world")
+ testdir.chdir()
assert result.ret == 0
result.stdout.fnmatch_lines([
"*test_hello.py::test_hello*PASSED",