Skip to content

Commit 7f94aae

Browse files
committed
Fix bug with splitting parametrized test name
"a.b.test_c[x.y]" should give ("a.b", "test_c[x.y]") and not ("a.b.test_c[x", "y]")
1 parent b8bcfe1 commit 7f94aae

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pytest_mpl/summary/html.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ def __init__(self, name, item, id):
9393

9494
# Name of test with module and test function together and separate
9595
self.full_name = name
96-
self.name = name.split('.')[-1]
97-
self.module = '.'.join(name.split('.')[:-1])
96+
without_parametrized_name = name.split("[")[0]
97+
self.module = ".".join(without_parametrized_name.split(".")[:-1])
98+
self.name = name[len(self.module)+1:]
9899

99100
# Additional classes to add to the result card
100101
self.classes = [f'{k}-{str(v).lower()}' for k, v in [

0 commit comments

Comments
 (0)