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.
- {pytest_check-2.7.6 → pytest_check-2.7.7}/PKG-INFO +1 -1
- {pytest_check-2.7.6 → pytest_check-2.7.7}/changelog.md +7 -0
- pytest_check-2.7.7/examples/test_example_non_assert_exceptions.py +22 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/pyproject.toml +1 -1
- {pytest_check-2.7.6 → pytest_check-2.7.7}/src/pytest_check/context_manager.py +1 -1
- pytest_check-2.7.7/tests/test_non_assert_exceptions.py +23 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/.coveragerc +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/.github/.deployment.md +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/.github/FUNDING.yml +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/.github/workflows/main.yml +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/.github/workflows/publish-to-pypi.yml +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/.gitignore +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/LICENSE.txt +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/README.md +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/logging_to_a_file/conftest.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/logging_to_a_file/test_file_logging.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_alt_names.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_any_failures.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_check_and_assert.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_check_check.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_check_func_decorator.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_check_not_in_test.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_context_functions.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_context_manager_fail.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_context_manager_pass.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_context_manager_type.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_fail_func.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_fail_in_fixture.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_fail_in_teardown_with_skip.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_fail_in_thread.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_functions_fail.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_functions_pass.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_helpers.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_httpx.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_locals.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_logging.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_maxfail.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_message.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_mix_checks_and_assertions.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_multiple_failures.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_mypy.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_mypy_fail.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_pass_in_thread.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_raises.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_simple.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_speedup_funcs.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_stop_on_fail.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_summary.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_tb_style.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_traceback.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_tracebackhide.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_xfail.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/src/pytest_check/__init__.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/src/pytest_check/__init__.pyi +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/src/pytest_check/check_functions.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/src/pytest_check/check_log.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/src/pytest_check/check_raises.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/src/pytest_check/plugin.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/src/pytest_check/pseudo_traceback.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/src/pytest_check/py.typed +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/__init__.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/conftest.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_alt_names.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_any_failures.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_check_and_assert.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_check_check.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_check_context_manager.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_check_fixture.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_check_func_decorator.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_fail_func.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_fail_in_fixture.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_fail_in_teardown_with_skip.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_functions.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_helpers.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_locals.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_logging.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_maxfail.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_message.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_not_in_test.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_raises.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_red.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_speedup_flags.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_speedup_functions.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_stop_on_fail.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_summary.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_tb_style.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_thread.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_tracebackhide.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tests/test_xfail.py +0 -0
- {pytest_check-2.7.6 → pytest_check-2.7.7}/tox.ini +0 -0
|
@@ -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.
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_fail_in_teardown_with_skip.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytest_check-2.7.6 → pytest_check-2.7.7}/examples/test_example_mix_checks_and_assertions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|