Fixture that allows to start HQ test environment
(tmp_path, debug=True)
| 363 | |
| 364 | @contextlib.contextmanager |
| 365 | def 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) |
no test coverage detected