Skip to content

Commit dbf586d

Browse files
committed
Default names.
1 parent 7c03dc1 commit dbf586d

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

jsonschema/tests/_suite.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ def optional_tests_of(self, name):
111111
path=self._path.descendant(["optional", name + ".json"]),
112112
)
113113

114-
def to_testcase(self, name, *suites, **kwargs):
114+
def to_testcase(self, *suites, **kwargs):
115+
name = kwargs.pop("name", "Test" + self.name.title())
115116
skip = kwargs.pop("skip", lambda test: None)
116117
methods = {
117118
test.method_name: _maybe_skip(skip(test))(

jsonschema/tests/test_jsonschema_test_suite.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ def narrow_unicode_build(test): # pragma: no cover
7070

7171

7272
TestDraft3 = DRAFT3.to_testcase(
73-
"TestDraft3",
7473
DRAFT3.tests(),
7574
DRAFT3.optional_tests_of(name="format"),
7675
DRAFT3.optional_tests_of(name="bignum"),
@@ -90,7 +89,6 @@ def narrow_unicode_build(test): # pragma: no cover
9089

9190

9291
TestDraft4 = DRAFT4.to_testcase(
93-
"TestDraft4",
9492
DRAFT4.tests(),
9593
DRAFT4.optional_tests_of(name="format"),
9694
DRAFT4.optional_tests_of(name="bignum"),
@@ -117,7 +115,6 @@ def narrow_unicode_build(test): # pragma: no cover
117115

118116

119117
TestDraft6 = DRAFT6.to_testcase(
120-
"TestDraft6",
121118
DRAFT6.tests(),
122119
DRAFT6.optional_tests_of(name="format"),
123120
DRAFT6.optional_tests_of(name="bignum"),
@@ -144,8 +141,8 @@ def narrow_unicode_build(test): # pragma: no cover
144141

145142

146143
TestDraft3LegacyTypeCheck = DRAFT3.to_testcase(
147-
"TestDraft3LegacyTypeCheck",
148144
DRAFT3.tests_of(name="type"),
145+
name="TestDraft3LegacyTypeCheck",
149146
Validator=create(
150147
meta_schema=Draft3Validator.META_SCHEMA,
151148
validators=Draft3Validator.VALIDATORS,
@@ -155,8 +152,8 @@ def narrow_unicode_build(test): # pragma: no cover
155152

156153

157154
TestDraft4LegacyTypeCheck = DRAFT4.to_testcase(
158-
"TestDraft4LegacyTypeCheck",
159155
DRAFT4.tests_of(name="type"),
156+
name="TestDraft4LegacyTypeCheck",
160157
Validator=create(
161158
meta_schema=Draft4Validator.META_SCHEMA,
162159
validators=Draft4Validator.VALIDATORS,

0 commit comments

Comments
 (0)