Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add human readable names for parameterized tests
Summary: `test_property_type_hints` is a parameterized test with many test cases. Consider a contrived example when one of those test cases fails. Without human readable names, the relevant portion of the failure looks like ``` Fail: thrift/test/thrift-python:abstract_types_test-cpython3.10 - test_property_type_hints_59 (thrift.test.thrift-python.abstract_types_test.ThriftPythonAbstractTypesTest) (0.0s) [2024-11-16T23:43:13.580-08:00] [2024-11-16T23:43:13.580-08:00] test_property_type_hints_59 (thrift.test.thrift-python.abstract_types_test.ThriftPythonAbstractTypesTest) ... FAIL ``` The failed test appears as `test_property_type_hints_59`, which doesn't make it easy for the human who has to debug this problem to find the test case that failed. With the human readable test name, the same failure looks like ``` Fail: thrift/test/thrift-python:abstract_types_test-cpython3.10 - test_property_type_hints_59_TestStructCopyAbstract_optional_i32 (thrift.test.thrift-python.abstract_types_test.ThriftPythonAbstractTypesTest) (0.0s) [2024-11-16T23:46:39.974-08:00] [2024-11-16T23:46:39.974-08:00] test_property_type_hints_59_TestStructCopyAbstract_optional_i32 (thrift.test.thrift-python.abstract_types_test.ThriftPythonAbstractTypesTest) ... FAIL ``` The failed test now appears as `test_property_type_hints_59_TestStructCopyAbstract_optional_i32`. This now allows the human to interpret `TestStructCopyAbstract_optional_i32` as `TestStructCopyAbstract.optional_i32` and search for that string, which makes it easier to find this needle in the haystack. Reviewed By: yoney Differential Revision: D65536377 fbshipit-source-id: 52387b729688a5e9d31258c7d9a8b1a19dffaedf
- Loading branch information