diff options
author | Bruno Oliveira <nicoddemus@gmail.com> | 2020-06-13 11:29:01 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-13 11:29:01 -0300 |
commit | ab6dacf1d1e1ff0c5be70a3c5f48e63168168721 (patch) | |
tree | aae4f802f10ebe6c5e2e7ec49a2221cc44c293ac /testing/acceptance_test.py | |
parent | 2c37585f58a4bc0e2b1ce635c9a004fff6218538 (diff) | |
download | pytest-ab6dacf1d1e1ff0c5be70a3c5f48e63168168721.tar.gz |
Introduce --import-mode=importlib (#7246)
Fix #5821
Co-authored-by: Ran Benita <ran@unusedvar.com>
Diffstat (limited to 'testing/acceptance_test.py')
-rw-r--r-- | testing/acceptance_test.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index 686fe1b98..d8f7a501a 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -147,7 +147,8 @@ class TestGeneralUsage: else: assert loaded == ["myplugin1", "myplugin2", "mycov"] - def test_assertion_magic(self, testdir): + @pytest.mark.parametrize("import_mode", ["prepend", "append", "importlib"]) + def test_assertion_rewrite(self, testdir, import_mode): p = testdir.makepyfile( """ def test_this(): @@ -155,7 +156,7 @@ class TestGeneralUsage: assert x """ ) - result = testdir.runpytest(p) + result = testdir.runpytest(p, "--import-mode={}".format(import_mode)) result.stdout.fnmatch_lines(["> assert x", "E assert 0"]) assert result.ret == 1 |