diff --git a/changelog.d/1114.downstream.rst b/changelog.d/1114.downstream.rst new file mode 100644 index 00000000..b3dd0ec8 --- /dev/null +++ b/changelog.d/1114.downstream.rst @@ -0,0 +1 @@ +Removed a test that had an ordering dependency on other tests. diff --git a/tests/async_fixtures/test_async_gen_fixtures.py b/tests/async_fixtures/test_async_gen_fixtures.py deleted file mode 100644 index ddc2f5be..00000000 --- a/tests/async_fixtures/test_async_gen_fixtures.py +++ /dev/null @@ -1,53 +0,0 @@ -from __future__ import annotations - -import unittest.mock - -import pytest - -START = object() -END = object() -RETVAL = object() - - -@pytest.fixture(scope="module") -def mock(): - return unittest.mock.Mock(return_value=RETVAL) - - -@pytest.fixture -async def async_gen_fixture(mock): - try: - yield mock(START) - except Exception as e: - mock(e) - else: - mock(END) - - -@pytest.mark.asyncio -async def test_async_gen_fixture(async_gen_fixture, mock): - assert mock.called - assert mock.call_args_list[-1] == unittest.mock.call(START) - assert async_gen_fixture is RETVAL - - -@pytest.mark.asyncio -async def test_async_gen_fixture_finalized(mock): - try: - assert mock.called - assert mock.call_args_list[-1] == unittest.mock.call(END) - finally: - mock.reset_mock() - - -class TestAsyncGenFixtureMethod: - is_same_instance = False - - @pytest.fixture(autouse=True) - async def async_gen_fixture_method(self): - self.is_same_instance = True - yield None - - @pytest.mark.asyncio - async def test_async_gen_fixture_method(self): - assert self.is_same_instance