Skip to content

Abstract classes should use the abc module #394

@ryan-collingham

Description

@ryan-collingham

Testplan is structured to make heavy use of inheritance between abstract base classes and concrete subclasses. To ease the development effort of creating a new subclass, we should leverage the standard library abc module to mark classes as abstract via the ABCMeta metaclass and to mark particular methods as abstract via the abstractmethod decorator.

Not only will this make it clearer visually which classes and methods are abstract, it will also enable a runtime check to ensure that all abstract methods are overridden by subclasses, therefore making it less likely to hit a NotImplementedError later at runtime.

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