Skip to content

Commit 4cc708f

Browse files
committed
attempted fix
1 parent d227968 commit 4cc708f

File tree

29 files changed

+12
-14
lines changed

29 files changed

+12
-14
lines changed

.github/workflows/tests.yaml

100644100755
File mode changed.

.gitignore

100644100755
File mode changed.

CONTRIBUTING.md

100644100755
File mode changed.

LICENSE

100644100755
File mode changed.

README.md

100644100755
File mode changed.

docs/reference.md

100644100755
File mode changed.

pytest_operator/__init__.py

100644100755
File mode changed.

pytest_operator/plugin.py

100644100755
Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ def tmp_path_factory(request):
149149
given_basetemp=Path(os.environ["TOX_ENV_DIR"]) / "tmp" / "pytest",
150150
trace=request.config.trace.get("tmpdir"),
151151
_ispytest=True,
152+
retention_count=1,
153+
retention_policy="failed"
152154
)
153155

154156

@@ -167,25 +169,13 @@ def check_deps(*deps):
167169
)
168170

169171

170-
@pytest.fixture(scope="module")
171-
def event_loop():
172-
"""Create an instance of the default event loop for each test module."""
173-
loop = asyncio.get_event_loop_policy().new_event_loop()
174-
yield loop
175-
loop.close()
176-
177-
178-
# Plugin load order can't be set, replace asyncio directly
179-
pytest_asyncio.plugin.event_loop = event_loop
180-
181-
182172
def pytest_collection_modifyitems(session, config, items):
183173
"""Automatically apply the "asyncio" marker to any async test items."""
184174
for item in items:
185175
is_async = inspect.iscoroutinefunction(getattr(item, "function", None))
186176
has_marker = item.get_closest_marker("asyncio")
187177
if is_async and not has_marker:
188-
item.add_marker("asyncio")
178+
item.add_marker(pytest.mark.asyncio(scope="module"))
189179

190180

191181
@pytest.hookimpl(tryfirst=True, hookwrapper=True)

pytest_operator/shims.py

100644100755
File mode changed.

setup.py

100644100755
File mode changed.

0 commit comments

Comments
 (0)