Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstract classes should use the abc module #394

Open
ryan-collingham opened this issue Mar 13, 2020 · 0 comments
Open

Abstract classes should use the abc module #394

ryan-collingham opened this issue Mar 13, 2020 · 0 comments

Comments

@ryan-collingham
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant