fix 'DoctestItem' object has no attribute '_fixtureinfo'
* doxtests don't seem to have this attribute, so nothing will be written in that case. * tried to be a good boy scout and tidied up surrounding code a bit (comments, shadowed/unused names, removed random new lines, naming things)
This commit is contained in:
@@ -135,3 +135,24 @@ def test_verbose_include_private_fixtures_and_loc(testdir):
|
||||
'arg3 -- test_verbose_include_private_fixtures_and_loc.py:3',
|
||||
' arg3 from testmodule',
|
||||
])
|
||||
|
||||
|
||||
def test_doctest_items(testdir):
|
||||
testdir.makepyfile('''
|
||||
def foo():
|
||||
"""
|
||||
>>> 1 + 1
|
||||
2
|
||||
"""
|
||||
''')
|
||||
testdir.maketxtfile('''
|
||||
>>> 1 + 1
|
||||
2
|
||||
''')
|
||||
result = testdir.runpytest("--fixtures-per-test", "--doctest-modules",
|
||||
"--doctest-glob=*.txt", "-v")
|
||||
assert result.ret == 0
|
||||
|
||||
result.stdout.fnmatch_lines([
|
||||
'*collected 2 items*',
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user