Skip to content

Commit e143abf

Browse files
committed
Lint
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
1 parent 8f219d8 commit e143abf

File tree

4 files changed

+19
-13
lines changed

4 files changed

+19
-13
lines changed

dali/test/python/nose_utils.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from nose2.tools.decorators import with_setup as _nose2_with_setup, with_teardown as _nose2_with_teardown
15+
from nose2.tools.decorators import (
16+
with_setup as _nose2_with_setup,
17+
with_teardown as _nose2_with_teardown,
18+
)
1619
from unittest import SkipTest # noqa: F401
1720
import unittest
1821
import re
1922
import fnmatch
2023
import functools
21-
import warnings
2224

2325

2426
def with_setup(setup=None, teardown=None):
@@ -31,12 +33,14 @@ def with_setup(setup=None, teardown=None):
3133
@with_setup(setup_func, teardown_func)
3234
@with_setup(teardown=teardown_func)
3335
"""
36+
3437
def decorator(func):
3538
if setup is not None:
3639
func = _nose2_with_setup(setup)(func)
3740
if teardown is not None:
3841
func = _nose2_with_teardown(teardown)(func)
3942
return func
43+
4044
return decorator
4145

4246

@@ -51,10 +55,12 @@ def attr(*tags):
5155
Usage: @attr("pytorch", "slow")
5256
Filtering: nose2 -A 'pytorch' or nose2 -A '!slow'
5357
"""
58+
5459
def decorator(func):
5560
for tag in tags:
5661
setattr(func, tag, True)
5762
return func
63+
5864
return decorator
5965

6066

dali/test/python/test_dltensor_operator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def pytorch_red_channel_op(in1, in2):
183183
return [t.narrow(2, 0, 1).squeeze() for t in in1], [t.narrow(2, 0, 1).squeeze() for t in in2]
184184

185185

186-
@attr('pytorch')
186+
@attr("pytorch")
187187
def test_pytorch():
188188
setup_pytorch()
189189
for testcase in [simple_pytorch_op, pytorch_red_channel_op]:
@@ -329,7 +329,7 @@ def cupy_kernel_gray_scale(in1, in2, stream=None):
329329
return out1, out2
330330

331331

332-
@attr('cupy')
332+
@attr("cupy")
333333
def test_cupy():
334334
setup_cupy()
335335
print(cupy)
@@ -338,7 +338,7 @@ def test_cupy():
338338
yield from _cupy_flip_with_negative_strides_suite()
339339

340340

341-
@attr('cupy')
341+
@attr("cupy")
342342
def test_cupy_kernel_gray_scale():
343343
setup_cupy()
344344
cupy_case(cupy_kernel_gray_scale, synchronize=False)

dali/test/python/test_fw_iterators_detection.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def test_mxnet_pipeline_dynamic_shape():
7474
assert data is not None
7575

7676

77-
@attr('pytorch')
77+
@attr("pytorch")
7878
def test_pytorch_pipeline_dynamic_shape():
7979
from nvidia.dali.plugin.pytorch import DALIGenericIterator as PyTorchIterator
8080

@@ -87,7 +87,7 @@ def test_pytorch_pipeline_dynamic_shape():
8787
assert data is not None
8888

8989

90-
@attr('paddle')
90+
@attr("paddle")
9191
def test_paddle_pipeline_dynamic_shape():
9292
from nvidia.dali.plugin.paddle import DALIGenericIterator as PaddleIterator
9393

@@ -100,7 +100,7 @@ def test_paddle_pipeline_dynamic_shape():
100100
assert data is not None
101101

102102

103-
@attr('pytorch')
103+
@attr("pytorch")
104104
def test_api_fw_check1_pytorch():
105105
from nvidia.dali.plugin.pytorch import DALIGenericIterator as PyTorchIterator
106106

@@ -120,7 +120,7 @@ def test_api_fw_check1_mxnet():
120120
)
121121

122122

123-
@attr('paddle')
123+
@attr("paddle")
124124
def test_api_fw_check1_paddle():
125125
from nvidia.dali.plugin.paddle import DALIGenericIterator as PaddleIterator
126126

@@ -176,14 +176,14 @@ def test_api_fw_check2_mxnet():
176176
)
177177

178178

179-
@attr('pytorch')
179+
@attr("pytorch")
180180
def test_api_fw_check2_pytorch():
181181
from nvidia.dali.plugin.pytorch import DALIGenericIterator as PyTorchIterator
182182

183183
yield from test_api_fw_check2(PyTorchIterator, ["data", "bboxes", "label"])
184184

185185

186-
@attr('paddle')
186+
@attr("paddle")
187187
def test_api_fw_check2_paddle():
188188
from nvidia.dali.plugin.paddle import DALIGenericIterator as PaddleIterator
189189

dali/test/python/test_pytorch_operator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def check_pytorch_operator(device):
114114
assert numpy.allclose(res2, exp2_t.numpy())
115115

116116

117-
@attr('pytorch')
117+
@attr("pytorch")
118118
def test_pytorch_operator():
119119
for device in {"cpu", "gpu"}:
120120
yield check_pytorch_operator, device
@@ -138,7 +138,7 @@ def check_pytorch_operator_batch_processing(device):
138138
assert numpy.allclose(res2, exp2[i].numpy())
139139

140140

141-
@attr('pytorch')
141+
@attr("pytorch")
142142
def test_pytorch_operator_batch_processing():
143143
for device in {"cpu", "gpu"}:
144144
yield check_pytorch_operator_batch_processing, device

0 commit comments

Comments
 (0)