From 1a41c12fc8128b438c40afd8b23e2b07480037ca Mon Sep 17 00:00:00 2001 From: James Hutchison <122519877+JamesHutchison@users.noreply.github.com> Date: Fri, 1 Dec 2023 01:27:43 +0000 Subject: [PATCH] add comments --- pytest_hot_reloading/daemon.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pytest_hot_reloading/daemon.py b/pytest_hot_reloading/daemon.py index 687f1be..3e9b2b1 100644 --- a/pytest_hot_reloading/daemon.py +++ b/pytest_hot_reloading/daemon.py @@ -253,16 +253,21 @@ def _manage_prior_session_garbage(session: pytest.Session) -> None: prior_session.__dict__ = session.__dict__ +# performance improvements +# when doing a best_effort_copy, do not copy these attributes no_copy = { "_arg2fixturedefs", "_fixtureinfo", "keywords", "_fixturemanager", "_pyfuncitem", - # '_request' } -use_best_effort_copy = {"_request"} +# when doing a best_effort_copy, do not deep copy this +# instead, force a best effort up to a given depth +use_best_effort_copy = { + "_request", +} def _pytest_main(config: pytest.Config, session: pytest.Session):