Skip to content

Commit 5cd8f53

Browse files
authored
Format using latest black (microsoft#13625)
1 parent 6256868 commit 5cd8f53

16 files changed

Lines changed: 277 additions & 82 deletions

File tree

pythonFiles/completion.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ def _get_top_level_module(cls, path):
8686
return path
8787

8888
def _generate_signature(self, completion):
89-
"""Generate signature with function arguments.
90-
"""
89+
"""Generate signature with function arguments."""
9190
if completion.type in ["module"] or not hasattr(completion, "params"):
9291
return ""
9392
return "%s(%s)" % (
@@ -551,8 +550,8 @@ def _set_request_config(self, config):
551550

552551
def _normalize_request_path(self, request):
553552
"""Normalize any Windows paths received by a *nix build of
554-
Python. Does not alter the reverse os.path.sep=='\\',
555-
i.e. *nix paths received by a Windows build of Python.
553+
Python. Does not alter the reverse os.path.sep=='\\',
554+
i.e. *nix paths received by a Windows build of Python.
556555
"""
557556
if "path" in request:
558557
if not self.drive_mount:
@@ -569,8 +568,7 @@ def _normalize_request_path(self, request):
569568
request["path"] = newPath
570569

571570
def _process_request(self, request):
572-
"""Accept serialized request from VSCode and write response.
573-
"""
571+
"""Accept serialized request from VSCode and write response."""
574572
request = self._deserialize(request)
575573

576574
self._set_request_config(request.get("config", {}))

pythonFiles/refactor.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ class ChangeType:
5252

5353

5454
class Change:
55-
"""
56-
"""
55+
""""""
5756

5857
EDIT = 0
5958
NEW = 1
@@ -337,8 +336,7 @@ def _deserialize(self, request):
337336
return json.loads(request)
338337

339338
def _process_request(self, request):
340-
"""Accept serialized request from VSCode and write response.
341-
"""
339+
"""Accept serialized request from VSCode and write response."""
342340
request = self._deserialize(request)
343341
lookup = request.get("lookup", "")
344342

pythonFiles/tests/debug_adapter/test_install_debugpy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ def _check_binaries(dir_path):
1919

2020

2121
@pytest.mark.skipif(
22-
sys.version_info[:2] != (3, 7), reason="DEBUGPY wheels shipped for Python 3.7 only",
22+
sys.version_info[:2] != (3, 7),
23+
reason="DEBUGPY wheels shipped for Python 3.7 only",
2324
)
2425
def test_install_debugpy(tmpdir):
2526
import install_debugpy

pythonFiles/tests/testing_tools/adapter/pytest/test_cli.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ def test_discover(self):
3535
add_subparser("discover", "pytest", subparsers)
3636

3737
self.assertEqual(
38-
stub.calls, [("subparsers.add_parser", None, {"name": "pytest"}),]
38+
stub.calls,
39+
[
40+
("subparsers.add_parser", None, {"name": "pytest"}),
41+
],
3942
)
4043

4144
def test_unsupported_command(self):

pythonFiles/tests/testing_tools/adapter/pytest/test_discovery.py

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,21 @@ def normcase(path):
187187
raise NotImplementedError
188188
##########
189189
def _fix_fileid(*args):
190-
return fix_fileid(*args, **dict(_normcase=normcase, _pathsep=pathsep,))
190+
return fix_fileid(
191+
*args,
192+
**dict(
193+
_normcase=normcase,
194+
_pathsep=pathsep,
195+
)
196+
)
191197

192198
def _normalize_test_id(*args):
193199
return pytest_item._normalize_test_id(
194-
*args, **dict(_fix_fileid=_fix_fileid, _pathsep=pathsep,)
200+
*args,
201+
**dict(
202+
_fix_fileid=_fix_fileid,
203+
_pathsep=pathsep,
204+
)
195205
)
196206

197207
def _iter_nodes(*args):
@@ -205,20 +215,39 @@ def _iter_nodes(*args):
205215
)
206216

207217
def _parse_node_id(*args):
208-
return pytest_item._parse_node_id(*args, **dict(_iter_nodes=_iter_nodes,))
218+
return pytest_item._parse_node_id(
219+
*args,
220+
**dict(
221+
_iter_nodes=_iter_nodes,
222+
)
223+
)
209224

210225
##########
211226
def _split_fspath(*args):
212-
return pytest_item._split_fspath(*args, **dict(_normcase=normcase,))
227+
return pytest_item._split_fspath(
228+
*args,
229+
**dict(
230+
_normcase=normcase,
231+
)
232+
)
213233

214234
##########
215235
def _matches_relfile(*args):
216236
return pytest_item._matches_relfile(
217-
*args, **dict(_normcase=normcase, _pathsep=pathsep,)
237+
*args,
238+
**dict(
239+
_normcase=normcase,
240+
_pathsep=pathsep,
241+
)
218242
)
219243

220244
def _is_legacy_wrapper(*args):
221-
return pytest_item._is_legacy_wrapper(*args, **dict(_pathsep=pathsep,))
245+
return pytest_item._is_legacy_wrapper(
246+
*args,
247+
**dict(
248+
_pathsep=pathsep,
249+
)
250+
)
222251

223252
def _get_location(*args):
224253
return pytest_item._get_location(
@@ -300,7 +329,9 @@ def test_failure(self):
300329

301330
self.assertEqual(
302331
stub.calls,
303-
[("pytest.main", None, {"args": self.DEFAULT_ARGS, "plugins": [plugin]}),],
332+
[
333+
("pytest.main", None, {"args": self.DEFAULT_ARGS, "plugins": [plugin]}),
334+
],
304335
)
305336

306337
def test_no_tests_found(self):
@@ -837,7 +868,9 @@ def test_doctest(self):
837868
id="./x/y/z/test_eggs.py::test_eggs",
838869
name="test_eggs",
839870
path=TestPath(
840-
root=testroot, relfile=fix_relpath(relfile), func=None,
871+
root=testroot,
872+
relfile=fix_relpath(relfile),
873+
func=None,
841874
),
842875
source="{}:{}".format(fix_relpath(relfile), 1),
843876
markers=[],
@@ -860,7 +893,9 @@ def test_doctest(self):
860893
id="./x/y/z/test_eggs.py::test_eggs.TestSpam",
861894
name="test_eggs.TestSpam",
862895
path=TestPath(
863-
root=testroot, relfile=fix_relpath(relfile), func=None,
896+
root=testroot,
897+
relfile=fix_relpath(relfile),
898+
func=None,
864899
),
865900
source="{}:{}".format(fix_relpath(relfile), 13),
866901
markers=[],
@@ -883,7 +918,9 @@ def test_doctest(self):
883918
id="./x/y/z/test_eggs.py::test_eggs.TestSpam.TestEggs",
884919
name="test_eggs.TestSpam.TestEggs",
885920
path=TestPath(
886-
root=testroot, relfile=fix_relpath(relfile), func=None,
921+
root=testroot,
922+
relfile=fix_relpath(relfile),
923+
func=None,
887924
),
888925
source="{}:{}".format(fix_relpath(relfile), 28),
889926
markers=[],

pythonFiles/tests/testing_tools/adapter/test___main__.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,12 @@ def test_unsupported_command(self):
4848

4949
class ParseDiscoverTests(unittest.TestCase):
5050
def test_pytest_default(self):
51-
tool, cmd, args, toolargs = parse_args(["discover", "pytest",])
51+
tool, cmd, args, toolargs = parse_args(
52+
[
53+
"discover",
54+
"pytest",
55+
]
56+
)
5257

5358
self.assertEqual(tool, "pytest")
5459
self.assertEqual(cmd, "discover")
@@ -88,7 +93,13 @@ def test_pytest_full(self):
8893

8994
def test_pytest_opts(self):
9095
tool, cmd, args, toolargs = parse_args(
91-
["discover", "pytest", "--simple", "--no-hide-stdio", "--pretty",]
96+
[
97+
"discover",
98+
"pytest",
99+
"--simple",
100+
"--no-hide-stdio",
101+
"--pretty",
102+
]
92103
)
93104

94105
self.assertEqual(tool, "pytest")
@@ -120,8 +131,14 @@ def test_discover(self):
120131
"discover",
121132
{"spam": "eggs"},
122133
[],
123-
_tools={tool.name: {"discover": tool.discover,}},
124-
_reporters={"discover": reporter.report,},
134+
_tools={
135+
tool.name: {
136+
"discover": tool.discover,
137+
}
138+
},
139+
_reporters={
140+
"discover": reporter.report,
141+
},
125142
)
126143

127144
self.assertEqual(

0 commit comments

Comments
 (0)