Skip to content

Commit 8284202

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent ba7f560 commit 8284202

File tree

7 files changed

+19
-30
lines changed

7 files changed

+19
-30
lines changed

nose2/plugins/prettyassert.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ def _get_inspection_info(trace):
137137
- statement which failed (which can be garbage -- don't trust it)
138138
- can_tokenize: a bool indicating that the lines of source can be parsed
139139
"""
140-
(frame, fname, lineno, funcname, context, ctx_index) = inspect.getinnerframes(
141-
trace
142-
)[-1]
140+
frame, fname, lineno, funcname, context, ctx_index = inspect.getinnerframes(trace)[
141+
-1
142+
]
143143
original_source_lines, firstlineno = inspect.getsourcelines(frame)
144144

145145
# truncate to the code in this frame to remove anything after current

nose2/tests/functional/test_collect_plugin.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ def test_collect_tests_in_package(self):
1717

1818

1919
# expectations
20-
EXPECT_LAYOUT1 = re.compile(
21-
r"""Ran 25 tests in \d.\d+s
20+
EXPECT_LAYOUT1 = re.compile(r"""Ran 25 tests in \d.\d+s
2221
23-
OK"""
24-
)
22+
OK""")

nose2/tests/functional/test_mp_plugin.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,20 +82,20 @@ def test_flatten_respects_class_fixtures(self):
8282

8383
def test_conn_prep(self):
8484
self.plugin.bind_host = None
85-
(parent_conn, child_conn) = self.plugin._prepConns()
86-
(parent_pipe, child_pipe) = multiprocessing.Pipe()
85+
parent_conn, child_conn = self.plugin._prepConns()
86+
parent_pipe, child_pipe = multiprocessing.Pipe()
8787
self.assertIsInstance(parent_conn, type(parent_pipe))
8888
self.assertIsInstance(child_conn, type(child_pipe))
8989

9090
self.plugin.bind_host = "127.0.0.1"
9191
self.plugin.bind_port = 0
92-
(parent_conn, child_conn) = self.plugin._prepConns()
92+
parent_conn, child_conn = self.plugin._prepConns()
9393
self.assertIsInstance(parent_conn, connection.Listener)
9494
self.assertIsInstance(child_conn, tuple)
9595
self.assertEqual(parent_conn.address, child_conn[:2])
9696

9797
def test_conn_accept(self):
98-
(parent_conn, child_conn) = multiprocessing.Pipe()
98+
parent_conn, child_conn = multiprocessing.Pipe()
9999
self.assertEqual(self.plugin._acceptConns(parent_conn), parent_conn)
100100

101101
listener = connection.Listener(("127.0.0.1", 0))
@@ -161,27 +161,23 @@ def test_dispatch_tests_receive_events(self):
161161
{
162162
"outcome": "failed",
163163
"expected": False,
164-
"metadata": {
165-
"stdout": """\
164+
"metadata": {"stdout": """\
166165
-------------------- >> begin captured stdout << ---------------------
167166
Hello stdout
168167
169-
--------------------- >> end captured stdout << ----------------------"""
170-
},
168+
--------------------- >> end captured stdout << ----------------------"""},
171169
},
172170
),
173171
(
174172
"testOutcome",
175173
{
176174
"outcome": "failed",
177175
"expected": False,
178-
"metadata": {
179-
"stdout": """\
176+
"metadata": {"stdout": """\
180177
-------------------- >> begin captured stdout << ---------------------
181178
Hello stdout
182179
183-
--------------------- >> end captured stdout << ----------------------"""
184-
},
180+
--------------------- >> end captured stdout << ----------------------"""},
185181
},
186182
),
187183
("stopTest", {}),

nose2/tests/unit/test_collector.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,10 @@ class TestCollector(TestCase):
1212

1313
def test_collector_completes_with_no_tests(self):
1414
with open("unittest.cfg", "w") as ut_file:
15-
ut_file.write(
16-
dedent(
17-
"""
15+
ut_file.write(dedent("""
1816
[unittest]
1917
quiet = true
20-
"""
21-
)
22-
)
18+
"""))
2319
test = collector.collector()
2420
with RedirectStdStreams() as redir:
2521
self.assertRaises(SystemExit, test.run, None)

nose2/tests/unit/test_doctest_plugin.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,13 @@ def test_handle_file_python_setup_py(self):
6969
# The file should be ignored by the plugin as it cannot safely be
7070
# imported.
7171

72-
setup_py = dedent(
73-
"""\
72+
setup_py = dedent("""\
7473
'''
7574
>>> never executed
7675
'''
7776
from setuptools import setup
7877
setup(name='foo')
79-
"""
80-
)
78+
""")
8179
event = self._handle_file("setup.py", setup_py)
8280
self.assertEqual(event.extraTests, [])
8381

nose2/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def object_from_name(name, module=None):
106106
import_error = None
107107
parts = name.split(".")
108108
if module is None:
109-
(module, import_error) = try_import_module_from_name(parts[:])
109+
module, import_error = try_import_module_from_name(parts[:])
110110
parts = parts[1:]
111111
parent = None
112112
obj = module

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ classifiers = [
3232
"Programming Language :: Python :: 3.11",
3333
"Programming Language :: Python :: 3.12",
3434
"Programming Language :: Python :: 3.13",
35+
"Programming Language :: Python :: 3.14",
3536
"Programming Language :: Python :: Implementation :: CPython",
3637
"Programming Language :: Python :: Implementation :: PyPy",
3738
"Topic :: Software Development :: Libraries",

0 commit comments

Comments
 (0)