Skip to content

Commit 9d17738

Browse files
Auto-format code with black
1 parent 9f9e494 commit 9d17738

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

thinc/tests/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33

44
# Functionally disable deadline settings for tests
55
# to prevent spurious test failures in CI builds.
6-
settings.register_profile("no_deadlines", deadline=2*60*1000) # in ms
6+
settings.register_profile("no_deadlines", deadline=2 * 60 * 1000) # in ms
77
settings.load_profile("no_deadlines")
88

9+
910
def pytest_sessionstart(session):
1011
# If Tensorflow is installed, attempt to enable memory growth
1112
# to prevent it from allocating all of the GPU's free memory

thinc/tests/test_util.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
ALL_XP = [numpy]
1313
try:
1414
import cupy
15+
1516
ALL_XP.append(cupy)
1617
except ImportError:
1718
pass
@@ -49,10 +50,12 @@ def test_get_width_fail(obj):
4950

5051
@pytest.mark.parametrize("xp", ALL_XP)
5152
def test_array_module_cpu_gpu_helpers(xp):
52-
error = ("Only numpy and cupy arrays are supported"
53-
", but found <class 'int'> instead. If "
54-
"get_array_module module wasn't called "
55-
"directly, this might indicate a bug in Thinc.")
53+
error = (
54+
"Only numpy and cupy arrays are supported"
55+
", but found <class 'int'> instead. If "
56+
"get_array_module module wasn't called "
57+
"directly, this might indicate a bug in Thinc."
58+
)
5659
with pytest.raises(ValueError, match=error):
5760
get_array_module(0)
5861
zeros = xp.zeros((1, 2))
@@ -135,14 +138,10 @@ def test_to_categorical(label_smoothing):
135138
):
136139
to_categorical(numpy.asarray([0, 0, 0]), label_smoothing=0.01),
137140

138-
with pytest.raises(
139-
ValueError, match=r"label_smoothing parameter"
140-
):
141+
with pytest.raises(ValueError, match=r"label_smoothing parameter"):
141142
to_categorical(numpy.asarray([0, 1, 2, 3, 4]), label_smoothing=0.8)
142143

143-
with pytest.raises(
144-
ValueError, match=r"label_smoothing parameter"
145-
):
144+
with pytest.raises(ValueError, match=r"label_smoothing parameter"):
146145
to_categorical(numpy.asarray([0, 1, 2, 3, 4]), label_smoothing=0.88)
147146

148147

0 commit comments

Comments
 (0)