Add some tests for check_dummies (#19146)
This commit is contained in:
@@ -105,9 +105,10 @@ def create_dummy_object(name, backend_name):
|
||||
return DUMMY_CLASS.format(name, backend_name)
|
||||
|
||||
|
||||
def create_dummy_files():
|
||||
def create_dummy_files(backend_specific_objects=None):
|
||||
"""Create the content of the dummy files."""
|
||||
backend_specific_objects = read_init()
|
||||
if backend_specific_objects is None:
|
||||
backend_specific_objects = read_init()
|
||||
# For special correspondence backend to module name as used in the function requires_modulename
|
||||
dummy_files = {}
|
||||
|
||||
|
||||
@@ -437,7 +437,7 @@ def module_to_test_file(module_fname):
|
||||
return ["tests/onnx/test_features.py", "tests/onnx/test_onnx.py", "tests/onnx/test_onnx_v2.py"]
|
||||
# Special case for utils (not the one in src/transformers, the ones at the root of the repo).
|
||||
elif len(splits) > 0 and splits[0] == "utils":
|
||||
default_test_file = f"tests/utils/test_utils_{module_name}"
|
||||
default_test_file = f"tests/repo_utils/test_{module_name}"
|
||||
elif len(splits) > 4 and splits[2] == "models":
|
||||
default_test_file = f"tests/models/{splits[3]}/test_{module_name}"
|
||||
elif len(splits) > 2 and splits[2].startswith("generation"):
|
||||
|
||||
Reference in New Issue
Block a user