Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pytest collection cache not being copied from #84

Merged
merged 2 commits into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ line-length = 98

[tool.poetry]
name = "pytest-hot-reloading"
version = "0.1.0-alpha.16"
version = "0.1.0-alpha.17"
description = ""
authors = ["James Hutchison <[email protected]>"]
readme = "README.md"
Expand Down
8 changes: 4 additions & 4 deletions pytest_hot_reloading/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,15 +367,15 @@ def best_effort_copy(item, depth_remaining=2, force_best_effort=False):
else:
print("Pytest Daemon: Using cached collection")
# Assign the prior test items (tests to run) and config to the current session
session.items = items # type: ignore
session.items = tuple(best_effort_copy(x) for x in items) # type: ignore
num_tests_collected = len(items)
session.config = config
for i in items:
for i in session.items:
# Items have references to the config and the session
i.config = config
i.session = session
if i._request:
i._request._pyfuncitem = i
if i._request: # type: ignore
i._request._pyfuncitem = i # type: ignore
config.hook.pytest_runtestloop(session=session)
prior_sessions.add(session)

Expand Down