From 12f2b684f518cb0eb53bea5eab73331a8e546096 Mon Sep 17 00:00:00 2001 From: James Hutchison <122519877+JamesHutchison@users.noreply.github.com> Date: Sat, 6 Jan 2024 07:35:50 +0000 Subject: [PATCH 1/2] Fix session cache not being copied from --- pytest_hot_reloading/daemon.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pytest_hot_reloading/daemon.py b/pytest_hot_reloading/daemon.py index 03c9219..643b7cf 100644 --- a/pytest_hot_reloading/daemon.py +++ b/pytest_hot_reloading/daemon.py @@ -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) From cc9840b7af5c8e1e6cf23b9f1900d86c8ef903be Mon Sep 17 00:00:00 2001 From: James Hutchison <122519877+JamesHutchison@users.noreply.github.com> Date: Sat, 6 Jan 2024 07:36:14 +0000 Subject: [PATCH 2/2] inc version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f3f5455..3b17080 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 "] readme = "README.md"