Skip to content

Releases: okken/pytest-check

2.8.0

22 Mar 15:16

Choose a tag to compare

  • Support Request #122: Feature proposal: Capability to mark checks as xfail
  • Allow check helper functions, including raises(), to accept an xfail reason. A failing check can now produce an xfailed test result, while a passing check does not produce xpass unless the test is already marked with @pytest.mark.xfail.
  • (docs) Document xfail support for check helper functions in the README.

2.7.7

20 Mar 15:37

Choose a tag to compare

Fixed

  • Allow CheckContextManager to catch any exception, not just AssertionError (#198).
    Non-assertion exceptions (IndexError, KeyError, AttributeError, etc.) are now properly caught and reported as check failures.

2.7.6

05 Mar 07:41

Choose a tag to compare

Fixed

  • (typing) Set comparison function types such that None is not allowed

2.7.5

05 Mar 07:01

Choose a tag to compare

Changed

  • Passing None to comparison functions like greater(), less(), etc. used to raise an exception, which caused a test failure and stopped the test.
    • That's unexpected with a check function.
    • So now the check fails with a meaningful error message and continues with the rest of the test.
  • (typing) Allow numpy floats with comparison functions to pass mypy.

2.7.4

04 Mar 03:52

Choose a tag to compare

Fixed

  • (typing) Allow mixed int/float arguments in strict mypy for comparison helpers by adding float numeric overloads for greater(), greater_equal(), less(), and less_equal() in check_functions.py.

2.7.3

02 Mar 23:18

Choose a tag to compare

Added

  • Add __init__.pyi stub file for IDE intellisense (e.g. VSCode) and static type checkers.
  • Add PEP 561 py.typed marker so the package is recognized as typed.
  • (examples) Add test_example_import_as.py to validate import pytest_check as check with mypy.

Fixed

  • Ignore dist-packages in pseudo stack trace - Fixes #196 - Thanks @siferati
  • (typing) Resolve remaining mypy errors for import pytest_check as check usage; internal adjustments in check_functions.py.

Changed

  • (ci) Rename "quality" job to "static-analysis"; split into separate jobs for static-analysis, pytest_earliest, and coverage; use Python 3.14 for quality jobs.
  • (tox) Add mypy env coverage for import-as style in examples.

2.7.2

28 Feb 00:28

Choose a tag to compare

Fixed

  • #184: Fix issues with mypy. The example in this issue now passes mypy. Also mypy is now being tested as part of tox.
  • (typing) Allow dynamic helper access on CheckContextManager for static analysis, so patterns like check.equal(...) type-check in fixture-annotated tests.

Changed

  • (typing) Update internal _Comparable* protocol comparison signatures to satisfy strict mypy checks.
  • (tox) Enable and expand mypy env checks to include examples/.
  • (tox) Install httpx in the mypy env so example type checking works without import ignores.
  • (examples) Switch decorator usage in test_example_check_func_decorator.py to import check_func directly for static type checking.
  • (examples) Add test_example_context_manager_type.py to document and validate context-manager fixture typing behavior.
  • (ci) Add a GitHub Actions quality job to run tox -e lint,mypy,pytest_earliest,coverage.

2.7.1

27 Feb 21:57

Choose a tag to compare

Added

  • (docs) Document custom message support (msg) in check.raises().
  • (tests) Add tests for custom messages in check.raises().
  • (docs) Document that built-in check methods return bool values.
  • (docs) Update pseudo-traceback examples to reflect the default single pseudo-traceback and show how to increase it with --check-max-tb=5.
  • (docs) Add check.call_on_fail() section with usage guidance.
  • (examples) Add runnable logging example in examples/logging_to_a_file/.

Fixed

  • (tests) Make test_raises_custom_msg compatible with pytest < 7.3 short-summary output.

2.7.0

25 Feb 06:28

Choose a tag to compare

Added

  • Support for raises parameter in @pytest.mark.xfail when using check context managers - Fixes #145 - Thanks @shairoth12

Fixed

  • Fix #190: pyright errors
  • Fix #145: Is the 'raises' parameter in xfail ignored? - not anymore

Changed

  • Internal: add fixture run_example_test in tests - Thanks @even-even
  • Update __all__ to include 'check' in pytest_check module - Fixes #190 - Thanks @taylermulligan

2.6.0

07 Oct 03:49

Choose a tag to compare

  • raises returns the exception value, so the excpected error message can be verified. - Thanks @shairoth12