xfail some tests for doctest support if pdbpp is installed
This commit is contained in:
parent
ca5d02df06
commit
8360c1e687
|
@ -1,6 +1,11 @@
|
||||||
from _pytest.doctest import DoctestItem, DoctestModule, DoctestTextfile
|
from _pytest.doctest import DoctestItem, DoctestModule, DoctestTextfile
|
||||||
import py, pytest
|
import py, pytest
|
||||||
|
|
||||||
|
import pdb
|
||||||
|
|
||||||
|
xfail_if_pdbpp_installed = pytest.mark.xfail(hasattr(pdb, "__author__"),
|
||||||
|
reason="doctest/pdbpp problem: https://bitbucket.org/antocuni/pdb/issue/24/doctests-fail-when-pdbpp-is-installed")
|
||||||
|
|
||||||
class TestDoctests:
|
class TestDoctests:
|
||||||
|
|
||||||
def test_collect_testtextfile(self, testdir):
|
def test_collect_testtextfile(self, testdir):
|
||||||
|
@ -154,6 +159,7 @@ class TestDoctests:
|
||||||
reprec = testdir.inline_run(p, "--doctest-modules")
|
reprec = testdir.inline_run(p, "--doctest-modules")
|
||||||
reprec.assertoutcome(failed=1)
|
reprec.assertoutcome(failed=1)
|
||||||
|
|
||||||
|
@xfail_if_pdbpp_installed
|
||||||
def test_doctestmodule_external_and_issue116(self, testdir):
|
def test_doctestmodule_external_and_issue116(self, testdir):
|
||||||
p = testdir.mkpydir("hello")
|
p = testdir.mkpydir("hello")
|
||||||
p.join("__init__.py").write(py.code.Source("""
|
p.join("__init__.py").write(py.code.Source("""
|
||||||
|
@ -193,6 +199,7 @@ class TestDoctests:
|
||||||
"*test_txtfile_failing.txt:2: DocTestFailure"
|
"*test_txtfile_failing.txt:2: DocTestFailure"
|
||||||
])
|
])
|
||||||
|
|
||||||
|
@xfail_if_pdbpp_installed
|
||||||
def test_txtfile_with_fixtures(self, testdir):
|
def test_txtfile_with_fixtures(self, testdir):
|
||||||
p = testdir.maketxtfile("""
|
p = testdir.maketxtfile("""
|
||||||
>>> dir = getfixture('tmpdir')
|
>>> dir = getfixture('tmpdir')
|
||||||
|
@ -202,6 +209,8 @@ class TestDoctests:
|
||||||
reprec = testdir.inline_run(p, )
|
reprec = testdir.inline_run(p, )
|
||||||
reprec.assertoutcome(passed=1)
|
reprec.assertoutcome(passed=1)
|
||||||
|
|
||||||
|
|
||||||
|
@xfail_if_pdbpp_installed
|
||||||
def test_doctestmodule_with_fixtures(self, testdir):
|
def test_doctestmodule_with_fixtures(self, testdir):
|
||||||
p = testdir.makepyfile("""
|
p = testdir.makepyfile("""
|
||||||
'''
|
'''
|
||||||
|
@ -213,6 +222,7 @@ class TestDoctests:
|
||||||
reprec = testdir.inline_run(p, "--doctest-modules")
|
reprec = testdir.inline_run(p, "--doctest-modules")
|
||||||
reprec.assertoutcome(passed=1)
|
reprec.assertoutcome(passed=1)
|
||||||
|
|
||||||
|
@xfail_if_pdbpp_installed
|
||||||
def test_doctestmodule_three_tests(self, testdir):
|
def test_doctestmodule_three_tests(self, testdir):
|
||||||
p = testdir.makepyfile("""
|
p = testdir.makepyfile("""
|
||||||
'''
|
'''
|
||||||
|
@ -238,6 +248,7 @@ class TestDoctests:
|
||||||
reprec = testdir.inline_run(p, "--doctest-modules")
|
reprec = testdir.inline_run(p, "--doctest-modules")
|
||||||
reprec.assertoutcome(passed=3)
|
reprec.assertoutcome(passed=3)
|
||||||
|
|
||||||
|
@xfail_if_pdbpp_installed
|
||||||
def test_doctestmodule_two_tests_one_fail(self, testdir):
|
def test_doctestmodule_two_tests_one_fail(self, testdir):
|
||||||
p = testdir.makepyfile("""
|
p = testdir.makepyfile("""
|
||||||
class MyClass:
|
class MyClass:
|
||||||
|
|
Loading…
Reference in New Issue