mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-04-20 22:13:49 +00:00
The mock_dispatcher fixture's fake_subscribe recorded event handlers but never called them, causing asyncio.wait() to block for the full DEFAULT_TIMEOUT (15s) on every test that passes expected_events to send(). With 28 affected tests, the suite wasted ~8 minutes on dead waits and required an undocumented pytest-timeout plugin to complete. Add call_soon to the default fake_subscribe so futures resolve on the next event loop iteration, matching the pattern already used by setup_event_response(). Override with a non-resolving mock in test_send_timeout to preserve timeout path coverage. Suite now completes in <1 second with no --timeout flag. |
||
|---|---|---|
| .. | ||
| unit | ||
| README.md | ||
| test_ble_connection.py | ||
| test_ble_pin_pairing.py | ||
| test_meshcore_ble_pin.py | ||
MeshCore Tests
Running Tests
To run the tests, first install the development dependencies:
pip install -e ".[dev]"
Then run the tests using pytest:
# Run all tests
pytest
# Run tests with verbose output
pytest -v
# Run a specific test file
pytest tests/unit/test_commands.py
# Run a specific test
pytest tests/unit/test_commands.py::test_send_msg