test files are rewritten in a subprocess

This commit is contained in:
Benjamin Peterson 2011-07-03 19:28:48 -05:00
parent fefdca5787
commit a4fe63c08d
1 changed files with 6 additions and 3 deletions

View File

@ -120,9 +120,12 @@ class TestAssert_reprcompare:
expl = ' '.join(callequal('foo', 'bar'))
assert 'raised in repr()' not in expl
@pytest.mark.skipif("config._assertstate.mode != 'rewrite'")
def test_rewritten():
assert "@py_builtins" in globals()
def test_rewritten(testdir):
testdir.makepyfile("""
def test_rewritten():
assert "@py_builtins" in globals()
""")
assert testdir.runpytest().ret == 0
def test_reprcompare_notin():
detail = plugin.pytest_assertrepr_compare('not in', 'foo', 'aaafoobbb')[1:]