File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -527,6 +527,29 @@ def test_toolongargs_issue224(testdir):
527
527
result = testdir .runpytest ("-m" , "hello" * 500 )
528
528
assert result .ret == EXIT_NOTESTSCOLLECTED
529
529
530
+ def test_config_in_subdirectory_colon_command_line_issue2148 (testdir ):
531
+ conftest_source = '''
532
+ def pytest_addoption(parser):
533
+ parser.addini('foo', 'foo')
534
+ '''
535
+
536
+ testdir .makefile ('.ini' , ** {
537
+ 'pytest' : '[pytest]\n foo = root' ,
538
+ 'subdir/pytest' : '[pytest]\n foo = subdir' ,
539
+ })
540
+
541
+ testdir .makepyfile (** {
542
+ 'conftest' : conftest_source ,
543
+ 'subdir/conftest' : conftest_source ,
544
+ 'subdir/test_foo' : '''
545
+ def test_foo(pytestconfig):
546
+ assert pytestconfig.getini('foo') == 'subdir'
547
+ ''' })
548
+
549
+ result = testdir .runpytest ('subdir/test_foo.py::test_foo' )
550
+ assert result .ret == 0
551
+
552
+
530
553
def test_notify_exception (testdir , capfd ):
531
554
config = testdir .parseconfig ()
532
555
excinfo = pytest .raises (ValueError , "raise ValueError(1)" )
You can’t perform that action at this time.
0 commit comments