Skip to content

pytest 8 failing tests #336

Closed
Closed
@jelly

Description

@jelly

Rebuilding against either 3.11 or 3.12 gives me test failures likely introduced by pytest 8 (as the tests succeed in Fedora with pytest 7).

=================================== FAILURES ===================================
________________ TestEncodeBitstring.test_implicit_unused_bits _________________

self = <ecdsa.test_der.TestEncodeBitstring testMethod=test_implicit_unused_bits>

    def test_implicit_unused_bits(self):
        """
        Writing bit string with already included the number of unused bits.
        """
        warnings.simplefilter("always")
>       with pytest.warns(None) as warns:

src/ecdsa/test_der.py:161:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = WarningsChecker(record=True), expected_warning = None, match_expr = None

    def __init__(
        self,
        expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]] = Warning,
        match_expr: Optional[Union[str, Pattern[str]]] = None,
        *,
        _ispytest: bool = False,
    ) -> None:
        check_ispytest(_ispytest)
        super().__init__(_ispytest=True)

        msg = "exceptions must be derived from Warning, not %s"
        if isinstance(expected_warning, tuple):
            for exc in expected_warning:
                if not issubclass(exc, Warning):
                    raise TypeError(msg % type(exc))
            expected_warning_tup = expected_warning
        elif isinstance(expected_warning, type) and issubclass(
            expected_warning, Warning
        ):
            expected_warning_tup = (expected_warning,)
        else:
>           raise TypeError(msg % type(expected_warning))
E           TypeError: exceptions must be derived from Warning, not <class 'NoneType'>

/usr/lib/python3.11/site-packages/_pytest/recwarn.py:285: TypeError
_________________ TestEncodeBitstring.test_new_call_convention _________________

self = <ecdsa.test_der.TestEncodeBitstring testMethod=test_new_call_convention>

    def test_new_call_convention(self):
        """This is how it should be called now."""
        warnings.simplefilter("always")
>       with pytest.warns(None) as warns:

src/ecdsa/test_der.py:148:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = WarningsChecker(record=True), expected_warning = None, match_expr = None

    def __init__(
        self,
        expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]] = Warning,
        match_expr: Optional[Union[str, Pattern[str]]] = None,
        *,
        _ispytest: bool = False,
    ) -> None:
        check_ispytest(_ispytest)
        super().__init__(_ispytest=True)

        msg = "exceptions must be derived from Warning, not %s"
        if isinstance(expected_warning, tuple):
            for exc in expected_warning:
                if not issubclass(exc, Warning):
                    raise TypeError(msg % type(exc))
            expected_warning_tup = expected_warning
        elif isinstance(expected_warning, type) and issubclass(
            expected_warning, Warning
        ):
            expected_warning_tup = (expected_warning,)
        else:
>           raise TypeError(msg % type(expected_warning))
E           TypeError: exceptions must be derived from Warning, not <class 'NoneType'>

/usr/lib/python3.11/site-packages/_pytest/recwarn.py:285: TypeError
_____________ TestRemoveBitstring.test_implicit_unexpected_unused ______________

self = <ecdsa.test_der.TestRemoveBitstring testMethod=test_implicit_unexpected_unused>

    def test_implicit_unexpected_unused(self):
        warnings.simplefilter("always")
>       with pytest.warns(None) as warns:

src/ecdsa/test_der.py:217:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = WarningsChecker(record=True), expected_warning = None, match_expr = None

    def __init__(
        self,
        expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]] = Warning,
        match_expr: Optional[Union[str, Pattern[str]]] = None,
        *,
        _ispytest: bool = False,
    ) -> None:
        check_ispytest(_ispytest)
        super().__init__(_ispytest=True)

        msg = "exceptions must be derived from Warning, not %s"
        if isinstance(expected_warning, tuple):
            for exc in expected_warning:
                if not issubclass(exc, Warning):
                    raise TypeError(msg % type(exc))
            expected_warning_tup = expected_warning
        elif isinstance(expected_warning, type) and issubclass(
            expected_warning, Warning
        ):
            expected_warning_tup = (expected_warning,)
        else:
>           raise TypeError(msg % type(expected_warning))
E           TypeError: exceptions must be derived from Warning, not <class 'NoneType'>

/usr/lib/python3.11/site-packages/_pytest/recwarn.py:285: TypeError
_________________ TestRemoveBitstring.test_new_call_convention _________________

self = <ecdsa.test_der.TestRemoveBitstring testMethod=test_new_call_convention>

    def test_new_call_convention(self):
        warnings.simplefilter("always")
>       with pytest.warns(None) as warns:

src/ecdsa/test_der.py:207:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = WarningsChecker(record=True), expected_warning = None, match_expr = None

    def __init__(
        self,
        expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]] = Warning,
        match_expr: Optional[Union[str, Pattern[str]]] = None,
        *,
        _ispytest: bool = False,
    ) -> None:
        check_ispytest(_ispytest)
        super().__init__(_ispytest=True)

        msg = "exceptions must be derived from Warning, not %s"
        if isinstance(expected_warning, tuple):
            for exc in expected_warning:
                if not issubclass(exc, Warning):
                    raise TypeError(msg % type(exc))
            expected_warning_tup = expected_warning
        elif isinstance(expected_warning, type) and issubclass(
            expected_warning, Warning
        ):
            expected_warning_tup = (expected_warning,)
        else:
>           raise TypeError(msg % type(expected_warning))
E           TypeError: exceptions must be derived from Warning, not <class 'NoneType'>

/usr/lib/python3.11/site-packages/_pytest/recwarn.py:285: TypeError
=============================== warnings summary ===============================
src/ecdsa/test_malformed_sigs.py::test_fuzzed_der_signatures
  /usr/lib/python3.11/site-packages/hypothesis/strategies/_internal/lazy.py:158: HypothesisWarning: Generating overly large repr. This is an expensive operation, and with a length of 68 kB is is unlikely to be useful. Use -Wignore to ignore the warning, or -Werror to get a traceback.
    self.__representation = repr_call(

src/ecdsa/test_malformed_sigs.py::test_fuzzed_string_signatures
  /usr/lib/python3.11/site-packages/hypothesis/strategies/_internal/lazy.py:158: HypothesisWarning: Generating overly large repr. This is an expensive operation, and with a length of 66 kB is is unlikely to be useful. Use -Wignore to ignore the warning, or -Werror to get a traceback.
    self.__representation = repr_call(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED src/ecdsa/test_der.py::TestEncodeBitstring::test_implicit_unused_bits
FAILED src/ecdsa/test_der.py::TestEncodeBitstring::test_new_call_convention
FAILED src/ecdsa/test_der.py::TestRemoveBitstring::test_implicit_unexpected_unused
FAILED src/ecdsa/test_der.py::TestRemoveBitstring::test_new_call_convention
============ 4 failed, 1759 passed, 5 skipped, 2 warnings in 10.19s ============

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions