MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / run_hq_env

Function run_hq_env

tests/conftest.py:365–381  ·  view source on GitHub ↗

Fixture that allows to start HQ test environment

(tmp_path, debug=True)

Source from the content-addressed store, hash-verified

363
364@contextlib.contextmanager
365def run_hq_env(tmp_path, debug=True):
366 """Fixture that allows to start HQ test environment"""
367 print("\nWorking dir", tmp_path)
368 os.chdir(tmp_path)
369
370 mock = ProgramMock(tmp_path.joinpath("mock"))
371 env = HqEnv(tmp_path, debug=debug, mock=mock)
372 yield env
373 try:
374 env.final_check()
375 env.check_running_processes()
376 finally:
377 env.close()
378 env.kill_all()
379 # Final sleep to let server port be freed, on some slow computers
380 # a new test is starter before the old server is properly cleaned
381 time.sleep(0.02)

Callers 2

hq_envFunction · 0.85
create_env_in_homeFunction · 0.85

Calls 7

final_checkMethod · 0.95
closeMethod · 0.95
ProgramMockClass · 0.85
HqEnvClass · 0.85
kill_allMethod · 0.80
sleepMethod · 0.80

Tested by

no test coverage detected