Skip to content

Commit 9c09d82

Browse files
Fix pytest collection cache not being copied from (#84)
* Fix session cache not being copied from * inc version
1 parent 93d134f commit 9c09d82

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ line-length = 98
99

1010
[tool.poetry]
1111
name = "pytest-hot-reloading"
12-
version = "0.1.0-alpha.16"
12+
version = "0.1.0-alpha.17"
1313
description = ""
1414
authors = ["James Hutchison <jamesghutchison@proton.me>"]
1515
readme = "README.md"

pytest_hot_reloading/daemon.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,15 +367,15 @@ def best_effort_copy(item, depth_remaining=2, force_best_effort=False):
367367
else:
368368
print("Pytest Daemon: Using cached collection")
369369
# Assign the prior test items (tests to run) and config to the current session
370-
session.items = items # type: ignore
370+
session.items = tuple(best_effort_copy(x) for x in items) # type: ignore
371371
num_tests_collected = len(items)
372372
session.config = config
373-
for i in items:
373+
for i in session.items:
374374
# Items have references to the config and the session
375375
i.config = config
376376
i.session = session
377-
if i._request:
378-
i._request._pyfuncitem = i
377+
if i._request: # type: ignore
378+
i._request._pyfuncitem = i # type: ignore
379379
config.hook.pytest_runtestloop(session=session)
380380
prior_sessions.add(session)
381381

0 commit comments

Comments
 (0)