Skip to content

Commit

Permalink
Fix pytest collection cache not being copied from (#84)
Browse files Browse the repository at this point in the history
* Fix session cache not being copied from

* inc version
  • Loading branch information
JamesHutchison authored Jan 6, 2024
1 parent 93d134f commit 9c09d82
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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

0 comments on commit 9c09d82

Please sign in to comment.