introduce an option that avoids discovery of classes other than unittest.TestCase in modules

importing unittest.
This commit is contained in:
holger krekel
2010-11-06 23:45:48 +01:00
parent 707775dcfa
commit d0ac4135a2
7 changed files with 46 additions and 15 deletions

View File

@@ -161,6 +161,15 @@ def test_functional(testdir):
result = testdir.runpytest("--no-assert")
assert "3 == 4" not in result.stdout.str()
def test_AssertionErrorIdentity(testdir):
testdir.makepyfile("""
def test_hello():
import exceptions
assert AssertionError is exceptions.AssertionError
""")
result = testdir.runpytest()
result.stdout.fnmatch_lines(["*1 passed*"])
def test_triple_quoted_string_issue113(testdir):
testdir.makepyfile("""
def test_hello():