File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 3
3
import contextlib
4
4
import glob
5
5
import io
6
+ import itertools
6
7
import json
7
8
import os
8
9
import pprint
@@ -72,6 +73,7 @@ def add_test_methods(test_class):
72
73
continue
73
74
74
75
validating , _ = os .path .splitext (os .path .basename (filename ))
76
+ id = itertools .count (1 )
75
77
76
78
with open (filename ) as test_file :
77
79
data = json .load (test_file )
@@ -84,8 +86,9 @@ def add_test_methods(test_class):
84
86
test ["valid" ],
85
87
)
86
88
87
- test_name = "test_%s_%s" % (
89
+ test_name = "test_%s_%s_% s" % (
88
90
validating ,
91
+ next (id ),
89
92
re .sub (r"[\W ]+" , "_" , test ["description" ]),
90
93
)
91
94
@@ -98,6 +101,7 @@ def add_test_methods(test_class):
98
101
a_test
99
102
)
100
103
104
+ assert not hasattr (test_class , test_name ), test_name
101
105
setattr (test_class , test_name , a_test )
102
106
103
107
return test_class
You can’t perform that action at this time.
0 commit comments