Skip to content

Commit 5b7b293

Browse files
A small update cupy with_requires() func
1 parent 9437f5b commit 5b7b293

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/third_party/cupy/testing/_helper.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ def with_requires(*requirements):
3333
This test case runs only when `numpy>=1.18` is installed.
3434
3535
>>> from cupy import testing
36+
...
37+
...
3638
... class Test(unittest.TestCase):
37-
... @testing.with_requires('numpy>=1.18')
39+
... @testing.with_requires("numpy>=1.18")
3840
... def test_for_numpy_1_18(self):
3941
... pass
4042
@@ -43,8 +45,8 @@ def with_requires(*requirements):
4345
run a given test case.
4446
4547
"""
46-
msg = "requires: {}".format(",".join(requirements))
47-
return _skipif(not installed(requirements), reason=msg)
48+
msg = f"requires: {','.join(requirements)}"
49+
return _skipif(not installed(*requirements), reason=msg)
4850

4951

5052
def installed(*specifiers):

0 commit comments

Comments
 (0)