summaryrefslogtreecommitdiff
path: root/testing/test_conftest.py
diff options
context:
space:
mode:
authorholger krekel <holger@merlinux.eu>2014-07-28 11:48:37 +0200
committerholger krekel <holger@merlinux.eu>2014-07-28 11:48:37 +0200
commit5ccd3f2fc51adc022196fcbf0765a0bc78efe3c8 (patch)
tree61a442dbfaccf8f4ccd800629253f191e4f2f78c /testing/test_conftest.py
parentba878c6d9d0360f52bb8eed1b99fe9bfeff0f80a (diff)
downloadpytest-5ccd3f2fc51adc022196fcbf0765a0bc78efe3c8.tar.gz
fix conftest detection if commandline arguments contain "::" syntax
--HG-- branch : fix_initial_parsing
Diffstat (limited to 'testing/test_conftest.py')
-rw-r--r--testing/test_conftest.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/testing/test_conftest.py b/testing/test_conftest.py
index 96df19550..8bf936dbe 100644
--- a/testing/test_conftest.py
+++ b/testing/test_conftest.py
@@ -237,3 +237,21 @@ def test_fixture_dependency(testdir, monkeypatch):
"""))
result = testdir.runpytest("sub")
result.stdout.fnmatch_lines(["*1 passed*"])
+
+
+def test_conftest_found_with_double_dash(testdir):
+ sub = testdir.mkdir("sub")
+ sub.join("conftest.py").write(py.std.textwrap.dedent("""
+ def pytest_addoption(parser):
+ parser.addoption("--hello-world", action="store_true")
+ """))
+ p = sub.join("test_hello.py")
+ p.write(py.std.textwrap.dedent("""
+ import pytest
+ def test_hello(found):
+ assert found == 1
+ """))
+ result = testdir.runpytest(str(p) + "@2::test_hello", "-h")
+ result.stdout.fnmatch_lines("""
+ *--hello-world*
+ """)