Fix session path monkeypatch

This commit is contained in:
Marek Wolan
2023-11-16 15:19:14 +00:00
parent 7545c25a46
commit 13c49bf3ea
2 changed files with 5 additions and 4 deletions

View File

@@ -100,7 +100,6 @@ class TempPrimaiteSession(PrimaiteSession):
@pytest.fixture
def temp_primaite_session(request, monkeypatch) -> TempPrimaiteSession:
"""Create a temporary PrimaiteSession object."""
with monkeypatch.context() as m:
m.setattr(PRIMAITE_PATHS, "user_sessions_path", temp_user_sessions_path())
config_path = request.param[0]
return TempPrimaiteSession.from_config(config_path=config_path)
monkeypatch.setattr(PRIMAITE_PATHS, "user_sessions_path", temp_user_sessions_path())
config_path = request.param[0]
return TempPrimaiteSession.from_config(config_path=config_path)

View File

@@ -40,6 +40,8 @@ class TestPrimaiteSession:
with temp_primaite_session as session:
session: TempPrimaiteSession
session.start_session()
for i in range(100):
print(session.io_manager.generate_session_path())
# TODO: include checks that the model was trained, e.g. that the loss changed and checkpoints were saved?
@pytest.mark.parametrize("temp_primaite_session", [[EVAL_ONLY_PATH]], indirect=True)