Skip to content

rename no_warning_call to assert_no_warnings & deprecate old name#131

Merged
Borda merged 11 commits into
mainfrom
rename/assert_no_warnings
Mar 13, 2026
Merged

rename no_warning_call to assert_no_warnings & deprecate old name#131
Borda merged 11 commits into
mainfrom
rename/assert_no_warnings

Conversation

@Borda

@Borda Borda commented Mar 13, 2026

Copy link
Copy Markdown
Owner
Before submitting
  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?

What does this PR do?

  • Rename no_warning_callassert_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=...)

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 🙃

…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>
Copilot AI review requested due to automatic review settings March 13, 2026 20:27
Comment thread src/deprecate/__init__.py Fixed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_warnings context manager in src/deprecate/utils.py (renamed from no_warning_call).
  • Update integration/unit tests to use assert_no_warnings and modernize parametrization IDs via pytest.param(..., id=...).
  • Update README examples to reference assert_no_warnings and 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.

Comment thread src/deprecate/__init__.py Outdated
Comment thread src/deprecate/__init__.py
Comment thread src/deprecate/utils.py
Comment thread src/deprecate/__init__.py Outdated
Comment thread tests/integration/test_utils.py
Comment thread README.md Outdated
@dosubot dosubot Bot added documentation Improvements or additions to documentation enhancement New feature or request tests labels Mar 13, 2026
Borda and others added 3 commits March 13, 2026 21:34
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
- 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.
Comment thread src/deprecate/utils.py Fixed
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_callassert_no_warnings in src/deprecate/utils.py and exported assert_no_warnings from deprecate.
  • Added a deprecated no_warning_call alias that emits a FutureWarning on use, plus integration tests covering both helpers (including FutureWarning cases).
  • Refactored several pytest.mark.parametrize(..., ids=...) usages to inline pytest.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.

Comment thread tests/integration/test_utils.py Outdated
Comment thread README.md Outdated
Borda and others added 3 commits March 13, 2026 22:13
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment thread src/deprecate/utils.py Outdated
Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_callassert_no_warnings in src/deprecate/utils.py and export the new name from deprecate.
  • Add a deprecated no_warning_call alias and extend integration tests (including FutureWarning coverage).
  • Refactor parametrized tests to use inline pytest.param(..., id=...) instead of ids=[...].

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.

Comment thread src/deprecate/utils.py
Comment thread tests/integration/test_utils.py
@Borda Borda merged commit 3896358 into main Mar 13, 2026
34 checks passed
@Borda Borda deleted the rename/assert_no_warnings branch March 13, 2026 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants