mkorpela / overrides

A decorator to automatically detect mismatch when overriding a method
Apache License 2.0
261 stars 32 forks source link

Test failure when running test suite in conda-forge feedstock #92

Open h-vetinari opened 2 years ago

h-vetinari commented 2 years ago

Hey all

overrides is also being packaged for conda-forge (not sure if people were aware), but it seems the so-called "feedstock" hasn't seen much attention from its maintainer in recent times. I rectified that, and now overrides is up-to-date again. 🥳

In bringing up the packaging "recipe" to best-practices, I'm now also running the test suite as a precondition for publishing a new build. However, there's one test failure (both on 5.0.1, as well as 6.0.1 / 6.1.0) when doing so**:

=================================== FAILURES ===================================
________________ EnforceTests.test_nested_typevar_in_signature _________________

self = <test_enforce__py38.EnforceTests testMethod=test_nested_typevar_in_signature>

    def test_nested_typevar_in_signature(self):
        T = TypeVar("T")
        K = TypeVar("K")

        def typevarred(t: Optional[T]) -> Optional[K]:
            pass

        def typed(t: Optional[str]) -> Optional[int]:
            pass

        def untyped(t):
            pass

        def return_typed(t) -> Optional[int]:
            pass

        ensure_signature_is_compatible(typevarred, untyped, True)
        ensure_signature_is_compatible(typevarred, typed, True)
        ensure_signature_is_compatible(untyped, typevarred, True)
        ensure_signature_is_compatible(typed, typevarred, True)
        ensure_signature_is_compatible(untyped, return_typed, True)
>       with self.assertRaises(TypeError):
E       AssertionError: TypeError not raised

tests/test_enforce__py38.py:429: AssertionError

If someone from the maintainers here wants to participate in the packaging for conda-forge, please just let me know. :)

** I've currently skipped that particular test when running the test suite to unblock the new versions, but I'd like to avoid that of course, hence this issue. See also https://github.com/conda-forge/overrides-feedstock/pull/22 & the CI run therein.

mkorpela commented 2 years ago

@h-vetinari is this still valid?