wolever / parameterized

Parameterized testing with any Python test framework
Other
836 stars 105 forks source link

Allow parameterized class to handle camel case test method names #106

Closed bobwalker99 closed 3 years ago

bobwalker99 commented 4 years ago

Hi, When parameterising a class with tests written with camel case names, the original base class doesn't have its test methods removed because they don't match the if method_name.startswith("test_"): evaluation. I only have limited influence over the naming conventions on the codebase I'm working on - can this evaluation be modified as per this PR?

Tested here: https://app.circleci.com/pipelines/github/bobwalker99/parameterized?branch=class_test_names2 (couldn't get CircleCI to build retrospectively on the original branch (class_test_names) so I built it on an identical branch class_test_names2.

bobwalker99 commented 3 years ago

Hi @wolever - is there anything I can do to help get this approved / pulled? Thanks, Bob

wolever commented 3 years ago

D'oh! Hopefully better late than never.

Yes! This is a good change, and conforms with unittest's description:

The three individual tests are defined with methods whose names start with the letters test

This will be part of the release that I'll be cutting later today.