Skip to content

Change qc range to raise warnings instead of raising error#550

Merged
rbeucher merged 1 commit into
mainfrom
feat/qc_range_raise_warnings_not_fail
Jul 23, 2026
Merged

Change qc range to raise warnings instead of raising error#550
rbeucher merged 1 commit into
mainfrom
feat/qc_range_raise_warnings_not_fail

Conversation

@rbeucher

Copy link
Copy Markdown
Member

This pull request updates the behavior of the _check_range method to emit warnings instead of raising errors when variable values fall outside the valid range. Corresponding tests have been updated to expect warnings rather than exceptions.

Core logic changes:

  • Changed _check_range in src/access_moppy/base.py to use warnings.warn (with UserWarning) instead of raising ValueError when values are out of the specified range.

Test updates:

  • Updated tests in tests/unit/test_base.py to check for warnings (using pytest.warns) instead of errors (using pytest.raises) for both below-minimum and above-maximum value cases. Test names and docstrings were updated to reflect the new warning behavior.
  • Renamed and updated the test in tests/unit/test_base_loading_chunker.py to expect warnings instead of errors for out-of-range values, and updated the docstring accordingly. [1] [2]

@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.9%. Comparing base (d0815eb) to head (11621b1).

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #550   +/-   ##
=====================================
  Coverage   74.9%   74.9%           
=====================================
  Files         36      36           
  Lines       7156    7156           
  Branches    1333    1333           
=====================================
  Hits        5357    5357           
  Misses      1519    1519           
  Partials     280     280           
Flag Coverage Δ
unit 74.9% <100.0%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rbeucher
rbeucher merged commit 8e5319e into main Jul 23, 2026
4 checks passed
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