14
0
Files
python-xmlschema/factory_tests.patch

118 lines
4.3 KiB
Diff
Raw Normal View History

--- a/tests/test_all.py
+++ b/tests/test_all.py
@@ -13,7 +13,7 @@ if __name__ == '__main__':
import os
import platform
- from xmlschema.testing import tests_factory, make_schema_test_class, \
+ from xmlschema.testing import factory_tests, make_schema_test_class, \
make_validation_test_class, get_test_program_args_parser
DEFAULT_TESTFILES = os.path.join(os.path.dirname(__file__), 'test_cases/testfiles')
@@ -46,7 +46,7 @@ if __name__ == '__main__':
args = get_test_program_args_parser(DEFAULT_TESTFILES).parse_args()
- schema_tests = tests_factory(
+ schema_tests = factory_tests(
test_class_builder=make_schema_test_class,
testfiles=args.testfiles,
suffix='xsd',
@@ -54,7 +54,7 @@ if __name__ == '__main__':
)
globals().update(schema_tests)
- validation_tests = tests_factory(
+ validation_tests = factory_tests(
test_class_builder=make_validation_test_class,
testfiles=args.testfiles,
suffix='xml',
--- a/tests/test_schemas.py
+++ b/tests/test_schemas.py
@@ -13,7 +13,7 @@
import os
from xmlschema.testing import get_test_program_args_parser, \
- tests_factory, make_schema_test_class
+ factory_tests, make_schema_test_class
DEFAULT_TESTFILES = os.path.join(os.path.dirname(__file__), 'test_cases/testfiles')
@@ -24,7 +24,7 @@ if __name__ == '__main__':
args = get_test_program_args_parser(DEFAULT_TESTFILES).parse_args()
- schema_tests = tests_factory(
+ schema_tests = factory_tests(
test_class_builder=make_schema_test_class,
testfiles=args.testfiles,
suffix='xsd',
@@ -47,7 +47,7 @@ if __name__ == '__main__':
catchbreak=args.catchbreak, buffer=args.buffer)
else:
# Creates schema tests from XSD files
- globals().update(tests_factory(
+ globals().update(factory_tests(
test_class_builder=make_schema_test_class,
suffix='xsd',
testfiles=DEFAULT_TESTFILES
--- a/tests/test_validation.py
+++ b/tests/test_validation.py
@@ -13,7 +13,7 @@
import os
from xmlschema.testing import get_test_program_args_parser, \
- tests_factory, make_validation_test_class
+ factory_tests, make_validation_test_class
DEFAULT_TESTFILES = os.path.join(os.path.dirname(__file__), 'test_cases/testfiles')
@@ -24,7 +24,7 @@ if __name__ == '__main__':
args = get_test_program_args_parser(DEFAULT_TESTFILES).parse_args()
- validation_tests = tests_factory(
+ validation_tests = factory_tests(
test_class_builder=make_validation_test_class,
testfiles=args.testfiles,
suffix='xml',
@@ -47,7 +47,7 @@ if __name__ == '__main__':
catchbreak=args.catchbreak, buffer=args.buffer)
else:
# Creates schema tests from XSD files
- globals().update(tests_factory(
+ globals().update(factory_tests(
test_class_builder=make_validation_test_class,
suffix='xml',
testfiles=DEFAULT_TESTFILES
--- a/xmlschema/testing/__init__.py
+++ b/xmlschema/testing/__init__.py
@@ -23,7 +23,7 @@ from urllib.error import URLError
from .case_class import XsdValidatorTestCase
from .builders import make_schema_test_class, make_validation_test_class
from .factory import get_test_args, xsd_version_number, defuse_data, \
- get_test_program_args_parser, get_test_line_args_parser, tests_factory
+ get_test_program_args_parser, get_test_line_args_parser, factory_tests
from .observers import SchemaObserver, ObservedXMLSchema10, ObservedXMLSchema11
@@ -46,6 +46,6 @@ SKIP_REMOTE_TESTS = not has_network_acce
__all__ = [
'XsdValidatorTestCase', 'make_schema_test_class', 'make_validation_test_class',
'get_test_args', 'xsd_version_number', 'defuse_data', 'get_test_program_args_parser',
- 'get_test_line_args_parser', 'tests_factory', 'SchemaObserver', 'ObservedXMLSchema10',
+ 'get_test_line_args_parser', 'factory_tests', 'SchemaObserver', 'ObservedXMLSchema10',
'ObservedXMLSchema11', 'has_network_access', 'SKIP_REMOTE_TESTS',
]
--- a/xmlschema/testing/factory.py
+++ b/xmlschema/testing/factory.py
@@ -117,7 +117,7 @@ def get_test_line_args_parser():
return parser
-def tests_factory(test_class_builder, testfiles, suffix, check_with_lxml=False):
+def factory_tests(test_class_builder, testfiles, suffix, check_with_lxml=False):
"""
Factory function for file based schema/validation cases.