Skip to content

Introduce cfg and document that the call to parent's __init__ is mandatory for ExampleParser, ExampleRunner, ExampleFinder, ZoneDelimiter and Concern #233

@eldipa

Description

@eldipa

Describe the feature you'd like
It was never documented and to by accident it is suggested that inherit from any of those extensive-points don't require calling parent's __init__ method but this is a problem if we want to share new variables (attributes) to PexpectMixin.

PexpectMixin assumes that it is inherited from a class that also inherits from ExampleRunner so it assumes that the attribute encoding and verbosity are set.

This is done by ExampleRunner and for all the subclasses but there is no enforcement.

To support #232 we need another attribute on PexpectMixin and clearly this will break any subclass that does not call ExampleRunner's __init__ (and therefore it will not have the attribute set and PexpectMixin will fail).

To fix this we will introduce cfg in the parent classes so any subclass will have access to any configuration parameter (including encoding and verbosity).

Also we will make verbosity and encoding as read-only properties and will make a warning of deprecation for them: in the next major should be removed.

Then, we will make clear in the documentation that the parent's __init__ must be called.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementsomething nice to have but it is not neither critical nor urgent

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions