Skip to content

Commit b9bdab0

Browse files
committed
fixed linters
1 parent 740e77a commit b9bdab0

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

datumaro/components/errors.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ class DatasetNotFoundError(DatasetImportError):
277277
filename = field(default="")
278278

279279
def __str__(self):
280-
file_ext_info = f", file '{self.filename}{self.ext}' was not found" if self.ext or self.filename else ''
280+
file_ext_info = f", file '{self.filename}{self.ext}' was not found" if self.ext or self.filename else ""
281281
return f"Failed to find dataset at '{self.path}' {file_ext_info}"
282282

283283

datumaro/components/wrappers.py

+11-6
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#
33
# SPDX-License-Identifier: MIT
44

5-
from unittest import mock
65
from typing import Optional, Callable
6+
from unittest import mock
77

88
from datumaro.components.errors import DatasetNotFoundError
99

@@ -20,8 +20,7 @@ def updated_find_sources_recursive(
2020
max_depth: int = 3,
2121
):
2222
sources = super(importer, cls)._find_sources_recursive(
23-
path, ext, extractor_name,
24-
filename, dirname, file_filter, max_depth
23+
path, ext, extractor_name, filename, dirname, file_filter, max_depth
2524
)
2625

2726
if not sources:
@@ -43,6 +42,12 @@ def updated_generate_not_found_error(cls, path):
4342
return updated_generate_not_found_error
4443

4544
def wrap_importer(importer):
46-
mock.patch.object(importer, '_find_sources_recursive', new=wrap_find_sources_recursive(importer)).start()
47-
mock.patch.object(importer, '_generate_not_found_error', new=wrap_generate_not_found_error()).start()
48-
mock.patch.object(importer, '_not_found_error_data', new={"ext": "", "filename": ""}, create=True).start()
45+
mock.patch.object(
46+
importer, '_find_sources_recursive', new=wrap_find_sources_recursive(importer)
47+
).start()
48+
mock.patch.object(
49+
importer, '_generate_not_found_error', new=wrap_generate_not_found_error()
50+
).start()
51+
mock.patch.object(
52+
importer, '_not_found_error_data', new={"ext": "", "filename": ""}, create=True
53+
).start()

0 commit comments

Comments
 (0)