Skip to content

Commit 6fc38e3

Browse files
committed
tweak class name prefix specification
1 parent 287bf41 commit 6fc38e3

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

test/test_unified_format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
globals().update(generate_test_classes(
2828
os.path.join(_TEST_PATH, 'valid-pass'),
2929
module=__name__,
30-
name_prefix='unified_test_format'))
30+
class_name_prefix='UnifiedTestFormat'))
3131

3232

3333
if __name__ == "__main__":

test/unified_format.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,12 +244,10 @@ def test_case(self):
244244
setattr(cls, test_name, test_method)
245245

246246

247-
def generate_test_classes(test_path, module=__name__, name_prefix=''):
247+
def generate_test_classes(test_path, module=__name__, class_name_prefix=''):
248248
"""Method for generating test classes. Returns a dictionary where keys are
249249
the names of test classes and values are the test class objects."""
250250
test_klasses = {}
251-
if name_prefix:
252-
name_prefix = name_prefix + '_'
253251

254252
def test_base_class_factory(test_spec):
255253
"""Utility that creates the base class to use for test generation.
@@ -272,8 +270,8 @@ class SpecTestBase(with_metaclass(UnifiedSpecTestMeta)):
272270
json_options=opts))
273271

274272
test_type = os.path.splitext(filename)[0]
275-
snake_class_name = 'Test_%s_%s' % (
276-
name_prefix + dirname.replace('-', '_'),
273+
snake_class_name = 'Test%s_%s_%s' % (
274+
class_name_prefix, dirname.replace('-', '_'),
277275
test_type.replace('-', '_').replace('.', '_'))
278276
class_name = snake_to_camel(snake_class_name)
279277

0 commit comments

Comments
 (0)