Skip to content

chore: lower coverage failure threshold from 100% to 10%#140

Merged
KJonline merged 9 commits into
devfrom
fix-coverage-upload
May 20, 2026
Merged

chore: lower coverage failure threshold from 100% to 10%#140
KJonline merged 9 commits into
devfrom
fix-coverage-upload

Conversation

@KJonline

Copy link
Copy Markdown
Contributor
  • Reduce --cov-fail-under from 100 to 10 in coverage workflow
  • Update fail_under from 0 to 10 in pyproject.toml coverage config

- Reduce --cov-fail-under from 100 to 10 in coverage workflow
- Update fail_under from 0 to 10 in pyproject.toml coverage config
@codecov

codecov Bot commented May 17, 2026

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

KJonline and others added 8 commits May 17, 2026 19:18
- Increase --cov-fail-under from 10 to 100 in coverage workflow
- Update fail_under from 10 to 100 in pyproject.toml coverage config
- Add flags, slug, and disable_search parameters to Codecov action
- Replace sys.gettrace() assertions with mock_settrace.assert_called_once_with() checks
- Import trace_debug function for direct comparison in test_set_debugging_with_function_sets_trace
- Remove manual sys.settrace(None) cleanup call
- Remove sys.settrace(None) cleanup from test_context_enter_sets_trace
- Wrap multiply() call in mock_settrace context in test_decorator_enabled_true_executes_function
- Remove sys.settrace(None) cleanup from test_init_with_debug_true_sets_trace
- Store previous trace function in _previous_trace before setting new trace
- Restore previous trace on exit instead of unconditionally clearing to None
- Skip sys.settrace calls entirely when context is disabled
- Add tests for disabled context behavior and previous trace restoration
… tests

- Add _reset_debug_list fixture that saves original debug list before each test
- Restore debug list to original state after test completion
- Import debug from apyhiveapi.hive module
The custom debug system (trace_debug, set_debugging, exception_handler,
DebugContext) called sys.settrace() without patching in tests, displacing
coverage.py's CTracer on Python <3.14 and causing CI to report ~50%
coverage even with all tests passing.

- Delete src/helper/debugger.py and tests/unit/test_debugger.py
- Remove debug, trace_debug, set_debugging, exception_handler from hive.py
- Strip debug-related tests from test_hive_module.py and test_hub.py
- Remove _restore_debug_global fixture from conftest.py (no longer needed)
- Add TestPollDevices to test_polling.py to cover _poll_devices directly
- Remove redundant --cov/--cov-report flags from coverage.yml (already in addopts)

All 939 tests pass at 100% coverage on Python 3.12, 3.13, and 3.14.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
asyncio.current_task() returns None inside run_until_complete() on
Python 3.10, so setting _update_task = None made None is None → True,
meaning the False branch of the finally guard (113->116) was never
reached in CI.

Using a unique sentinel object ensures the branch fires on every Python
version regardless of how pytest-asyncio schedules the coroutine.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove --cov-fail-under=100 flag from coverage workflow (use pyproject.toml value)
- Reduce fail_under from 100 to 99 in pyproject.toml coverage config
@KJonline KJonline merged commit bce43e8 into dev May 20, 2026
10 checks passed
@KJonline KJonline deleted the fix-coverage-upload branch May 20, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant