rename no_warning_call to assert_no_warnings & deprecate old name#131
Conversation
…ate old name - Rename `no_warning_call` → `assert_no_warnings` in utils.py for consistency with Python testing conventions (mirrors `assertWarns`/`assertRaises`) - Keep `no_warning_call` as a deprecated alias in `__init__.py` (removed in v1.0) - Add `FutureWarning` coverage to `TestWarningCall` with `raise_pow_future` target - Convert all `ids=[...]` parametrize lists to inline `pytest.param(..., id=...)` Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Pull request overview
This PR renames the public testing helper no_warning_call to assert_no_warnings to better match common Python testing naming conventions, and updates tests/docs accordingly while attempting to keep the old name as a deprecated alias.
Changes:
- Introduce
assert_no_warningscontext manager insrc/deprecate/utils.py(renamed fromno_warning_call). - Update integration/unit tests to use
assert_no_warningsand modernize parametrization IDs viapytest.param(..., id=...). - Update README examples to reference
assert_no_warningsand add FutureWarning coverage in test targets.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
src/deprecate/utils.py |
Renames no_warning_call implementation to assert_no_warnings and updates docstring/examples. |
src/deprecate/__init__.py |
Exports assert_no_warnings and introduces a deprecated no_warning_call alias. |
tests/integration/test_utils.py |
Switches tests to assert_no_warnings, expands coverage (incl. FutureWarning), and refactors parametrization. |
tests/collection_targets.py |
Adds raise_pow_future target to exercise FutureWarning behavior. |
tests/integration/test_functions.py |
Replaces no_warning_call usage with assert_no_warnings. |
tests/integration/test_classes.py |
Replaces no_warning_call usage with assert_no_warnings. |
tests/integration/test_instance.py |
Refactors parametrization IDs using pytest.param(..., id=...). |
tests/unittests/test_proxy.py |
Refactors parametrization IDs using pytest.param(..., id=...). |
tests/unittests/test_audit.py |
Refactors parametrization IDs using pytest.param(..., id=...). |
README.md |
Updates documentation/examples to use assert_no_warnings. |
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
for more information, see https://pre-commit.ci
- Replace direct `warnings.warn` call with `_raise_warn_callable` for consistency and to avoid circular imports. - Add integration tests for `no_warning_call` alias to ensure continued functionality with deprecation warnings. - Minor updates to module imports for cleanup and better readability.
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR standardizes the test helper naming by introducing assert_no_warnings (as the preferred public API) while keeping no_warning_call as a deprecated compatibility alias, and updates tests/docs to use the new name.
Changes:
- Renamed
no_warning_call→assert_no_warningsinsrc/deprecate/utils.pyand exportedassert_no_warningsfromdeprecate. - Added a deprecated
no_warning_callalias that emits aFutureWarningon use, plus integration tests covering both helpers (includingFutureWarningcases). - Refactored several
pytest.mark.parametrize(..., ids=...)usages to inlinepytest.param(..., id=...).
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unittests/test_proxy.py | Converts parametrization IDs to inline pytest.param(..., id=...). |
| tests/unittests/test_audit.py | Converts parametrization IDs to inline pytest.param(..., id=...). |
| tests/integration/test_utils.py | Switches core tests to assert_no_warnings; adds coverage for deprecated alias + FutureWarning. |
| tests/integration/test_instance.py | Converts parametrization IDs to inline pytest.param(..., id=...). |
| tests/integration/test_functions.py | Replaces usages/imports of no_warning_call with assert_no_warnings. |
| tests/integration/test_classes.py | Replaces usages/imports of no_warning_call with assert_no_warnings. |
| tests/collection_targets.py | Adds raise_pow_future helper to emit FutureWarning for testing. |
| src/deprecate/utils.py | Introduces assert_no_warnings; reintroduces no_warning_call as a deprecated alias emitting FutureWarning. |
| src/deprecate/init.py | Exports assert_no_warnings at top-level and keeps deprecated no_warning_call import for compatibility. |
| README.md | Updates documentation examples and references to use assert_no_warnings. |
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ing` instead of `FutureWarning`
Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
…alidation and refactor for readability
There was a problem hiding this comment.
Pull request overview
This PR standardizes the testing helper naming by introducing assert_no_warnings as the primary API, keeping no_warning_call as a deprecated alias, and updates tests/docs accordingly.
Changes:
- Rename
no_warning_call→assert_no_warningsinsrc/deprecate/utils.pyand export the new name fromdeprecate. - Add a deprecated
no_warning_callalias and extend integration tests (includingFutureWarningcoverage). - Refactor parametrized tests to use inline
pytest.param(..., id=...)instead ofids=[...].
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unittests/test_proxy.py | Switch parametrization to inline pytest.param(..., id=...). |
| tests/unittests/test_audit.py | Switch parametrization to inline pytest.param(..., id=...). |
| tests/integration/test_utils.py | Update tests to assert_no_warnings, add alias coverage, add FutureWarning target. |
| tests/integration/test_instance.py | Switch parametrization to inline pytest.param(..., id=...). |
| tests/integration/test_functions.py | Replace no_warning_call usage with assert_no_warnings. |
| tests/integration/test_classes.py | Replace no_warning_call usage with assert_no_warnings. |
| tests/collection_targets.py | Add raise_pow_future target for FutureWarning test coverage. |
| src/deprecate/utils.py | Add assert_no_warnings and implement deprecated no_warning_call alias. |
| src/deprecate/init.py | Export assert_no_warnings from the package root; keep deprecated import. |
| README.md | Update documentation/examples to use assert_no_warnings. |
You can also share your feedback on Copilot code review. Take the survey.
Before submitting
What does this PR do?
no_warning_call→assert_no_warningsin utils.py for consistency with Python testing conventions (mirrorsassertWarns/assertRaises)no_warning_callas a deprecated alias in__init__.py(removed in v1.0)FutureWarningcoverage toTestWarningCallwithraise_pow_futuretargetids=[...]parametrize lists to inlinepytest.param(..., id=...)PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃