Ran `poetry run black --check .` and `black src/tests/test_nostr_index_size.py src/tests/test_nostr_sdk_workflow.py`
to fix code formatting issues in the test audit run, which caused GitHub
Actions CI checks to fail.
Co-authored-by: PR0M3TH3AN <[email protected]>
Replaced non-deterministic `time.sleep` calls with active polling loops or
thread joins in `src/tests/` to improve test determinism and reliability.
Modified `test_unlock_sync.py`, `test_nostr_sdk_workflow.py`,
`test_background_relay_check.py`, `test_offline_mode_behavior.py`, and
`test_nostr_index_size.py`.
Generated integrity and audit reports in `reports/test-audit/`.
Completed the scheduler rotation by publishing completion logic and
task log file to `torch/task-logs/daily/`.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Added `pytest.importorskip` calls for `pty` and `termios` to `src/tests/test_ai_tui_agent_harness.py`.
- Formatted `torch/scripts/test-audit/run_python_static_analysis.py` and `torch/scripts/test-audit/run_python_flaky_check.py` using `black`.
Co-authored-by: PR0M3TH3AN <[email protected]>
Added pytest.importorskip calls for 'pty' and 'termios' modules in
test_ai_tui_agent_harness.py to fix test failures on Windows where
these modules are unavailable.
Co-authored-by: PR0M3TH3AN <[email protected]>
Added `pytest.importorskip("pty")` and `pytest.importorskip("termios")` before `_load_harness_module()` call to properly skip `test_ai_tui_agent_harness.py` on Windows environments where these modules are not available. This prevents the `ModuleNotFoundError: No module named 'termios'` error during pytest collection.
Co-authored-by: PR0M3TH3AN <[email protected]>
Fixed broken documentation links pointing to non-existent \`docs/agent-handoffs/learnings\`
and \`docs/prompt-versioning.md\` files in \`TORCH.md\` and \`scheduler-lock.mjs\`.
Completed memory storage/retrieval steps and finalized the scheduler loop by
writing the required \`_completed.md\` task log.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Skip `src/tests/test_ai_tui_agent_harness.py` on Windows to avoid `ImportError` due to missing `termios`/`pty` modules.
- Ensure the harness module is only loaded if the skip condition is not met.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Formatted `src/tests/conftest.py` using `black` to fix CI formatting failures.
- This change ensures compliance with the repository's strict formatting checks (`poetry run black --check .`).
Co-authored-by: PR0M3TH3AN <[email protected]>
- Manually applied PEP 8 formatting (sorted imports, correct spacing) to `src/tests/conftest.py` to satisfy `poetry run black --check .` in CI.
- Retained the robust `try-import-except` logic for `trio` detection.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Made `trio` backend detection in `src/tests/conftest.py` robust by using `try-import-except` instead of `find_spec`, fixing `ModuleNotFoundError` in environments where `find_spec` behavior differs or trio is partially present but not importable.
- Prevented test pollution in `src/tests/test_gui_features.py` by adding `try...finally` block to unsubscribe `refresh_codes` from the global `bus`, ensuring subsequent CLI tests (like `test_nostr_sync`) don't crash due to lingering callbacks.
- Hardened `src/seedpass_gui/app.py` against test-induced errors:
- `TotpViewerWindow.refresh_codes` now accepts `*args, **kwargs` to safely ignore event arguments if called via subscription.
- `MainWindow.vault_locked` catches `ValueError` when closing, handling cases where the window is already detached in test environments.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Restored `src/tests/conftest.py` from `.bak` to fix missing `trio` conditional check, resolving `ModuleNotFoundError: No module named 'trio'`.
- Added `clean_pubsub` autouse fixture to `conftest.py` to clear the global `bus` subscribers between tests. This prevents test pollution that was causing `TypeError` in CLI tests and `ValueError` in GUI tests due to lingering callbacks.
Co-authored-by: PR0M3TH3AN <[email protected]>