merge master into features

This commit is contained in:
Ronny Pfannschmidt
2017-01-26 12:00:52 +01:00
59 changed files with 366 additions and 259 deletions

View File

@@ -59,6 +59,23 @@ class TestImportHookInstallation:
assert 0
result.stdout.fnmatch_lines([expected])
def test_rewrite_assertions_pytester_plugin(self, testdir):
"""
Assertions in the pytester plugin must also benefit from assertion
rewriting (#1920).
"""
testdir.makepyfile("""
pytest_plugins = ['pytester']
def test_dummy_failure(testdir): # how meta!
testdir.makepyfile('def test(): assert 0')
r = testdir.inline_run()
r.assertoutcome(passed=1)
""")
result = testdir.runpytest_subprocess()
result.stdout.fnmatch_lines([
'*assert 1 == 0*',
])
@pytest.mark.parametrize('mode', ['plain', 'rewrite'])
def test_pytest_plugins_rewrite(self, testdir, mode):
contents = {