Skip to content

Possible redundant assertion issubclass(type(a), type(a)) #63120

@rc4typecheck

Description

@rc4typecheck

Since a class is considered a subclass of itself, the expression issubclass(type(a), type(a)) is always True. Therefore, the following three assert statements in /pandas/tests/dtypes/test_dtypes.py seem redundant and meaningless to me:

class TestDatetimeTZDtype(Base):
    def test_subclass(self):
        assert issubclass(type(a), type(a))

class TestPeriodDtype(Base):
    def test_subclass(self):
        assert issubclass(type(a), type(a))

class TestIntervalDtype(Base):
    def test_subclass(self):
        assert issubclass(type(a), type(a))

If there is some special purpose behind the assertion, could you please confirm? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CleanTestingpandas testing functions or related to the test suite

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions