Skip to content

stop hardcoding "test" prefix in parameterized_class #183

@adk-swisstopo

Description

@adk-swisstopo

In #73 and

# We need to leave the base class in place (see issue #73), but if we
# leave the test_ methods in place, the test runner will try to pick
# them up and run them... which doesn't make sense, since no parameters
# will have been applied.
# Address this by iterating over the base class and remove all test
# methods.
for method_name in list(base_class.__dict__):
if method_name.startswith("test"):
delattr(base_class, method_name)
return base_class
parameterized_class was updated to remove the test* methods from the base class. We sometimes use a custom test runner to run test-like methods in parameterized classes. These methods have a different prefix than test*. It would be nice if we could specify that prefix such that parameterized_class would remove these methods from the base class.

Can you please provide a mechanism to change the prefix of the methods that parameterized_class removes from the base class instead of having it hardcoded to test*?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions