Skip to content

Commit

Permalink
Failing test for issue pytest-dev#2148.
Browse files Browse the repository at this point in the history
  • Loading branch information
pelme committed Dec 20, 2016
1 parent da40bcf commit 187b971
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions testing/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,29 @@ def test_toolongargs_issue224(testdir):
result = testdir.runpytest("-m", "hello" * 500)
assert result.ret == EXIT_NOTESTSCOLLECTED

def test_config_in_subdirectory_colon_command_line_issue2148(testdir):
conftest_source = '''
def pytest_addoption(parser):
parser.addini('foo', 'foo')
'''

testdir.makefile('.ini', **{
'pytest': '[pytest]\nfoo = root',
'subdir/pytest': '[pytest]\nfoo = subdir',
})

testdir.makepyfile(**{
'conftest': conftest_source,
'subdir/conftest': conftest_source,
'subdir/test_foo': '''
def test_foo(pytestconfig):
assert pytestconfig.getini('foo') == 'subdir'
'''})

result = testdir.runpytest('subdir/test_foo.py::test_foo')
assert result.ret == 0


def test_notify_exception(testdir, capfd):
config = testdir.parseconfig()
excinfo = pytest.raises(ValueError, "raise ValueError(1)")
Expand Down

0 comments on commit 187b971

Please sign in to comment.