When a test is embedded within a class, the TRIM_FROM_NAME option from the "pytest_discover_tests" function applies to the class name instead of the method name.
class TestWorld:
def test_greet(self):
"""Greet the world."""
assert example.greet() == "hello, world"
test 1
Start 1: PythonTest.TestWorld.test_greet
We should create a TRIM_FROM_CLASS_NAME function to trim class names and fix the existing TRIM_FROM_NAME option to make it work with methods for consistency.
When a test is embedded within a class, the
TRIM_FROM_NAME
option from the "pytest_discover_tests" function applies to the class name instead of the method name.We should create a
TRIM_FROM_CLASS_NAME
function to trim class names and fix the existingTRIM_FROM_NAME
option to make it work with methods for consistency.