diff --git a/changelog.d/1334.downstream.rst b/changelog.d/1334.downstream.rst new file mode 100644 index 00000000..7aa9dda0 --- /dev/null +++ b/changelog.d/1334.downstream.rst @@ -0,0 +1 @@ +Fixed six tests that failed with ``PytestAssertRewriteWarning`` when the test suite is run from an unpacked sdist using the ``pytest`` command. diff --git a/tests/markers/test_class_scope.py b/tests/markers/test_class_scope.py index 45583c3a..cecd4ec5 100644 --- a/tests/markers/test_class_scope.py +++ b/tests/markers/test_class_scope.py @@ -197,5 +197,5 @@ class TestClass: async def test_anything(self): pass """)) - result = pytester.runpytest("--asyncio-mode=strict") + result = pytester.runpytest("--asyncio-mode=strict", "--assert=plain") result.assert_outcomes(warnings=0, passed=1) diff --git a/tests/markers/test_module_scope.py b/tests/markers/test_module_scope.py index a814a9d7..64d5f7d7 100644 --- a/tests/markers/test_module_scope.py +++ b/tests/markers/test_module_scope.py @@ -189,5 +189,5 @@ def test_standalone_test_does_not_trigger_warning_about_no_current_event_loop_be async def test_anything(): pass """)) - result = pytester.runpytest("--asyncio-mode=strict") + result = pytester.runpytest("--asyncio-mode=strict", "--assert=plain") result.assert_outcomes(warnings=0, passed=1) diff --git a/tests/markers/test_session_scope.py b/tests/markers/test_session_scope.py index 07ccdaa7..265b1a2b 100644 --- a/tests/markers/test_session_scope.py +++ b/tests/markers/test_session_scope.py @@ -292,5 +292,5 @@ def test_standalone_test_does_not_trigger_warning_about_no_current_event_loop_be async def test_anything(): pass """)) - result = pytester.runpytest("--asyncio-mode=strict") + result = pytester.runpytest("--asyncio-mode=strict", "--assert=plain") result.assert_outcomes(warnings=0, passed=1) diff --git a/tests/test_event_loop_fixture.py b/tests/test_event_loop_fixture.py index 8902511b..78a09122 100644 --- a/tests/test_event_loop_fixture.py +++ b/tests/test_event_loop_fixture.py @@ -24,7 +24,9 @@ async def generator_fn(): gen = generator_fn() await gen.__anext__() """)) - result = pytester.runpytest("--asyncio-mode=strict", "-W", "default") + result = pytester.runpytest( + "--asyncio-mode=strict", "-W", "default", "--assert=plain" + ) result.assert_outcomes(passed=1, warnings=0) @@ -77,5 +79,7 @@ async def fail(): raise RuntimeError("mock error cleaning up...") loop.shutdown_asyncgens = fail """)) - result = pytester.runpytest("--asyncio-mode=strict", "-W", "default") + result = pytester.runpytest( + "--asyncio-mode=strict", "-W", "default", "--assert=plain" + ) result.assert_outcomes(passed=1, warnings=1)