From 0cc0feb5bad7d4b78b9a213bea9aa026f6cb28dc Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Tue, 4 Feb 2025 09:21:14 +0000 Subject: automatic import of python-pydantic --- ...ert_raises_validation_error-with-pytest-8.patch | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 backport-Fix-test_assert_raises_validation_error-with-pytest-8.patch (limited to 'backport-Fix-test_assert_raises_validation_error-with-pytest-8.patch') diff --git a/backport-Fix-test_assert_raises_validation_error-with-pytest-8.patch b/backport-Fix-test_assert_raises_validation_error-with-pytest-8.patch new file mode 100644 index 0000000..c4a981c --- /dev/null +++ b/backport-Fix-test_assert_raises_validation_error-with-pytest-8.patch @@ -0,0 +1,34 @@ +From 22f86ad2ae1df0e1ca33a93275a1dd69d9d50988 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= +Date: Sat, 16 Mar 2024 09:57:41 +0100 +Subject: [PATCH] Fix `test_assert_raises_validation_error` with pytest-8 + (#8995) (#9024) + +--- + tests/test_validators.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tests/test_validators.py b/tests/test_validators.py +index 09311f6007..c2039a19b8 100644 +--- a/tests/test_validators.py ++++ b/tests/test_validators.py +@@ -808,16 +808,16 @@ + + @validator('a') + def check_a(cls, v): +- assert v == 'a', 'invalid a' ++ if v != 'a': ++ raise AssertionError('invalid a') + return v + + Model(a='a') + + with pytest.raises(ValidationError) as exc_info: + Model(a='snap') +- injected_by_pytest = "\nassert 'snap' == 'a'\n - a\n + snap" + assert exc_info.value.errors() == [ +- {'loc': ('a',), 'msg': f'invalid a{injected_by_pytest}', 'type': 'assertion_error'} ++ {'loc': ('a',), 'msg': 'invalid a', 'type': 'assertion_error'} + ] + + -- cgit v1.2.3