()
| 32 | |
| 33 | @pytest.mark.requires_external_processes |
| 34 | def test_daemon_runner(): |
| 35 | # We have a pseudo daemon task called 'check_status' |
| 36 | # which creates a temp file called STATUS_FILE under |
| 37 | # user's temp directory. This test simply ensures that |
| 38 | # we create a daemon that successfully performs the |
| 39 | # external task. |
| 40 | |
| 41 | status_file = Path(tempfile.gettempdir()) / STATUS_FILE |
| 42 | with suppress(FileNotFoundError): |
| 43 | status_file.unlink() |
| 44 | |
| 45 | spawn_daemon('check_status') |
| 46 | |
| 47 | for attempt in range(MAX_ATTEMPT): |
| 48 | time.sleep(MAX_TIMEOUT / MAX_ATTEMPT) |
| 49 | if status_file.exists(): |
| 50 | break |
| 51 | else: |
| 52 | pytest.fail( |
| 53 | 'Maximum number of attempts failed for daemon status check.' |
| 54 | ) |
| 55 | |
| 56 | assert status_file.exists() |
| 57 | |
| 58 | |
| 59 | def test_fetch(static_fetch_data, without_warnings): |
nothing calls this directly
no test coverage detected