Merged in witsch/pytest/doctest-fixtures (pull request #25)
fixture support in doctests
This commit is contained in:
@@ -124,3 +124,23 @@ class TestDoctests:
|
||||
" 1",
|
||||
"*test_txtfile_failing.txt:2: DocTestFailure"
|
||||
])
|
||||
|
||||
def test_txtfile_with_fixtures(self, testdir):
|
||||
p = testdir.maketxtfile("""
|
||||
>>> dir = getfixture('tmpdir')
|
||||
>>> type(dir).__name__
|
||||
'LocalPath'
|
||||
""")
|
||||
reprec = testdir.inline_run(p, )
|
||||
reprec.assertoutcome(passed=1)
|
||||
|
||||
def test_doctestmodule_with_fixtures(self, testdir):
|
||||
p = testdir.makepyfile("""
|
||||
'''
|
||||
>>> dir = getfixture('tmpdir')
|
||||
>>> type(dir).__name__
|
||||
'LocalPath'
|
||||
'''
|
||||
""")
|
||||
reprec = testdir.inline_run(p, "--doctest-modules")
|
||||
reprec.assertoutcome(passed=1)
|
||||
|
||||
Reference in New Issue
Block a user