pytest-check 2.7.6__tar.gz → 2.7.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. {pytest_check-2.7.6 → pytest_check-2.7.7}/PKG-INFO +1 -1
  2. {pytest_check-2.7.6 → pytest_check-2.7.7}/changelog.md +7 -0
  3. pytest_check-2.7.7/examples/test_example_non_assert_exceptions.py +22 -0
  4. {pytest_check-2.7.6 → pytest_check-2.7.7}/pyproject.toml +1 -1
  5. {pytest_check-2.7.6 → pytest_check-2.7.7}/src/pytest_check/context_manager.py +1 -1
  6. pytest_check-2.7.7/tests/test_non_assert_exceptions.py +23 -0
  7. {pytest_check-2.7.6 → pytest_check-2.7.7}/.coveragerc +0 -0
  8. {pytest_check-2.7.6 → pytest_check-2.7.7}/.github/.deployment.md +0 -0
  9. {pytest_check-2.7.6 → pytest_check-2.7.7}/.github/FUNDING.yml +0 -0
  10. {pytest_check-2.7.6 → pytest_check-2.7.7}/.github/workflows/main.yml +0 -0
  11. {pytest_check-2.7.6 → pytest_check-2.7.7}/.github/workflows/publish-to-pypi.yml +0 -0
  12. {pytest_check-2.7.6 → pytest_check-2.7.7}/.gitignore +0 -0
  13. {pytest_check-2.7.6 → pytest_check-2.7.7}/LICENSE.txt +0 -0
  14. {pytest_check-2.7.6 → pytest_check-2.7.7}/README.md +0 -0
  15. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/logging_to_a_file/conftest.py +0 -0
  16. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/logging_to_a_file/test_file_logging.py +0 -0
  17. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_alt_names.py +0 -0
  18. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_any_failures.py +0 -0
  19. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_check_and_assert.py +0 -0
  20. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_check_check.py +0 -0
  21. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_check_func_decorator.py +0 -0
  22. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_check_not_in_test.py +0 -0
  23. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_context_functions.py +0 -0
  24. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_context_manager_fail.py +0 -0
  25. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_context_manager_pass.py +0 -0
  26. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_context_manager_type.py +0 -0
  27. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_fail_func.py +0 -0
  28. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_fail_in_fixture.py +0 -0
  29. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_fail_in_teardown_with_skip.py +0 -0
  30. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_fail_in_thread.py +0 -0
  31. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_functions_fail.py +0 -0
  32. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_functions_pass.py +0 -0
  33. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_helpers.py +0 -0
  34. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_httpx.py +0 -0
  35. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_locals.py +0 -0
  36. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_logging.py +0 -0
  37. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_maxfail.py +0 -0
  38. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_message.py +0 -0
  39. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_mix_checks_and_assertions.py +0 -0
  40. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_multiple_failures.py +0 -0
  41. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_mypy.py +0 -0
  42. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_mypy_fail.py +0 -0
  43. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_pass_in_thread.py +0 -0
  44. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_raises.py +0 -0
  45. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_simple.py +0 -0
  46. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_speedup_funcs.py +0 -0
  47. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_stop_on_fail.py +0 -0
  48. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_summary.py +0 -0
  49. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_tb_style.py +0 -0
  50. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_traceback.py +0 -0
  51. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_tracebackhide.py +0 -0
  52. {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_xfail.py +0 -0
  53. {pytest_check-2.7.6 → pytest_check-2.7.7}/src/pytest_check/__init__.py +0 -0
  54. {pytest_check-2.7.6 → pytest_check-2.7.7}/src/pytest_check/__init__.pyi +0 -0
  55. {pytest_check-2.7.6 → pytest_check-2.7.7}/src/pytest_check/check_functions.py +0 -0
  56. {pytest_check-2.7.6 → pytest_check-2.7.7}/src/pytest_check/check_log.py +0 -0
  57. {pytest_check-2.7.6 → pytest_check-2.7.7}/src/pytest_check/check_raises.py +0 -0
  58. {pytest_check-2.7.6 → pytest_check-2.7.7}/src/pytest_check/plugin.py +0 -0
  59. {pytest_check-2.7.6 → pytest_check-2.7.7}/src/pytest_check/pseudo_traceback.py +0 -0
  60. {pytest_check-2.7.6 → pytest_check-2.7.7}/src/pytest_check/py.typed +0 -0
  61. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/__init__.py +0 -0
  62. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/conftest.py +0 -0
  63. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_alt_names.py +0 -0
  64. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_any_failures.py +0 -0
  65. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_check_and_assert.py +0 -0
  66. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_check_check.py +0 -0
  67. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_check_context_manager.py +0 -0
  68. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_check_fixture.py +0 -0
  69. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_check_func_decorator.py +0 -0
  70. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_fail_func.py +0 -0
  71. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_fail_in_fixture.py +0 -0
  72. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_fail_in_teardown_with_skip.py +0 -0
  73. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_functions.py +0 -0
  74. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_helpers.py +0 -0
  75. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_locals.py +0 -0
  76. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_logging.py +0 -0
  77. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_maxfail.py +0 -0
  78. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_message.py +0 -0
  79. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_not_in_test.py +0 -0
  80. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_raises.py +0 -0
  81. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_red.py +0 -0
  82. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_speedup_flags.py +0 -0
  83. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_speedup_functions.py +0 -0
  84. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_stop_on_fail.py +0 -0
  85. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_summary.py +0 -0
  86. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_tb_style.py +0 -0
  87. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_thread.py +0 -0
  88. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_tracebackhide.py +0 -0
  89. {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_xfail.py +0 -0
  90. {pytest_check-2.7.6 → pytest_check-2.7.7}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest-check
3
- Version: 2.7.6
3
+ Version: 2.7.7
4
4
  Summary: A pytest plugin that allows multiple failures per test.
5
5
  Project-URL: Home, https://github.com/okken/pytest-check
6
6
  Author: Brian Okken
@@ -28,6 +28,13 @@ All notable changes to this project will be documented in this file.
28
28
 
29
29
  -->
30
30
 
31
+ ## [2.7.7] - 2026-Mar-20
32
+
33
+ ### Fixed
34
+
35
+ - Allow CheckContextManager to catch any exception, not just AssertionError (#198).
36
+ Non-assertion exceptions (IndexError, KeyError, AttributeError, etc.) are now properly caught and reported as check failures.
37
+
31
38
  ## [2.7.6] - 2026-Mar-04
32
39
 
33
40
  ### Fixed
@@ -0,0 +1,22 @@
1
+ """
2
+ Non-assert exceptions should also be caught by check.
3
+ All of these should report "Failed Checks: 1"
4
+ """
5
+
6
+
7
+ def test_index_error(check):
8
+ a_list: list[str] = []
9
+ with check:
10
+ assert a_list[-1] == "Expected Value"
11
+
12
+
13
+ def test_key_error(check):
14
+ a_dict: dict[str, str] = {}
15
+ with check:
16
+ assert a_dict["k"] == "v"
17
+
18
+
19
+ def test_attribute_error(check):
20
+ an_object: object = object()
21
+ with check:
22
+ assert an_object.v == "obj" # type: ignore[attr-defined]
@@ -4,7 +4,7 @@ authors = [{name = "Brian Okken"}]
4
4
  readme = "README.md"
5
5
  license = {file = "LICENSE.txt"}
6
6
  description="A pytest plugin that allows multiple failures per test."
7
- version = "2.7.6"
7
+ version = "2.7.7"
8
8
  requires-python = ">=3.9"
9
9
  classifiers = [
10
10
  'Development Status :: 5 - Production/Stable',
@@ -29,7 +29,7 @@ class CheckContextManager:
29
29
  exc_tb: TracebackType | None,
30
30
  ) -> bool | None:
31
31
  __tracebackhide__ = True
32
- if exc_type is not None and issubclass(exc_type, AssertionError):
32
+ if exc_type is not None:
33
33
  if _stop_on_fail:
34
34
  self.msg = None
35
35
  return None
@@ -0,0 +1,23 @@
1
+
2
+ def test_index_error(pytester):
3
+ pytester.copy_example("examples/test_example_non_assert_exceptions.py")
4
+ result = pytester.runpytest("-k", "test_index_error")
5
+ result.assert_outcomes(failed=1, passed=0)
6
+ result.stdout.fnmatch_lines(["IndexError:*", "Failed Checks: 1"])
7
+
8
+
9
+
10
+ def test_key_error(pytester):
11
+ pytester.copy_example("examples/test_example_non_assert_exceptions.py")
12
+ result = pytester.runpytest("-k", "test_key_error")
13
+ result.assert_outcomes(failed=1, passed=0)
14
+ print('stdout:', result.stdout.str(), '---')
15
+ print('stderr:', result.stderr.str(), '---')
16
+ result.stdout.fnmatch_lines([ "KeyError:*", "Failed Checks: 1"])
17
+
18
+
19
+ def test_attribute_error(pytester):
20
+ pytester.copy_example("examples/test_example_non_assert_exceptions.py")
21
+ result = pytester.runpytest("-k", "test_attribute_error")
22
+ result.assert_outcomes(failed=1, passed=0)
23
+ result.stdout.fnmatch_lines(["AttributeError:*", "Failed Checks: 1"])
File without changes
File without changes
File without changes
File without changes
File without changes