Skip to content

Commit 6223203

Browse files
committed
Format using latest black (microsoft#13625)
1 parent f865f9d commit 6223203

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
@@ -185,11 +185,21 @@ def normcase(path):
185185
raise NotImplementedError
186186
##########
187187
def _fix_fileid(*args):
188-
return fix_fileid(*args, **dict(_normcase=normcase, _pathsep=pathsep,))
188+
return fix_fileid(
189+
*args,
190+
**dict(
191+
_normcase=normcase,
192+
_pathsep=pathsep,
193+
)
194+
)
189195

190196
def _normalize_test_id(*args):
191197
return pytest_item._normalize_test_id(
192-
*args, **dict(_fix_fileid=_fix_fileid, _pathsep=pathsep,)
198+
*args,
199+
**dict(
200+
_fix_fileid=_fix_fileid,
201+
_pathsep=pathsep,
202+
)
193203
)
194204

195205
def _iter_nodes(*args):
@@ -203,20 +213,39 @@ def _iter_nodes(*args):
203213
)
204214

205215
def _parse_node_id(*args):
206-
return pytest_item._parse_node_id(*args, **dict(_iter_nodes=_iter_nodes,))
216+
return pytest_item._parse_node_id(
217+
*args,
218+
**dict(
219+
_iter_nodes=_iter_nodes,
220+
)
221+
)
207222

208223
##########
209224
def _split_fspath(*args):
210-
return pytest_item._split_fspath(*args, **dict(_normcase=normcase,))
225+
return pytest_item._split_fspath(
226+
*args,
227+
**dict(
228+
_normcase=normcase,
229+
)
230+
)
211231

212232
##########
213233
def _matches_relfile(*args):
214234
return pytest_item._matches_relfile(
215-
*args, **dict(_normcase=normcase, _pathsep=pathsep,)
235+
*args,
236+
**dict(
237+
_normcase=normcase,
238+
_pathsep=pathsep,
239+
)
216240
)
217241

218242
def _is_legacy_wrapper(*args):
219-
return pytest_item._is_legacy_wrapper(*args, **dict(_pathsep=pathsep,))
243+
return pytest_item._is_legacy_wrapper(
244+
*args,
245+
**dict(
246+
_pathsep=pathsep,
247+
)
248+
)
220249

221250
def _get_location(*args):
222251
return pytest_item._get_location(
@@ -286,7 +315,9 @@ def test_failure(self):
286315

287316
self.assertEqual(
288317
stub.calls,
289-
[("pytest.main", None, {"args": self.DEFAULT_ARGS, "plugins": [plugin]}),],
318+
[
319+
("pytest.main", None, {"args": self.DEFAULT_ARGS, "plugins": [plugin]}),
320+
],
290321
)
291322

292323
def test_no_tests_found(self):
@@ -778,7 +809,9 @@ def test_doctest(self):
778809
id="./x/y/z/test_eggs.py::test_eggs",
779810
name="test_eggs",
780811
path=TestPath(
781-
root=testroot, relfile=fix_relpath(relfile), func=None,
812+
root=testroot,
813+
relfile=fix_relpath(relfile),
814+
func=None,
782815
),
783816
source="{}:{}".format(fix_relpath(relfile), 1),
784817
markers=[],
@@ -801,7 +834,9 @@ def test_doctest(self):
801834
id="./x/y/z/test_eggs.py::test_eggs.TestSpam",
802835
name="test_eggs.TestSpam",
803836
path=TestPath(
804-
root=testroot, relfile=fix_relpath(relfile), func=None,
837+
root=testroot,
838+
relfile=fix_relpath(relfile),
839+
func=None,
805840
),
806841
source="{}:{}".format(fix_relpath(relfile), 13),
807842
markers=[],
@@ -824,7 +859,9 @@ def test_doctest(self):
824859
id="./x/y/z/test_eggs.py::test_eggs.TestSpam.TestEggs",
825860
name="test_eggs.TestSpam.TestEggs",
826861
path=TestPath(
827-
root=testroot, relfile=fix_relpath(relfile), func=None,
862+
root=testroot,
863+
relfile=fix_relpath(relfile),
864+
func=None,
828865
),
829866
source="{}:{}".format(fix_relpath(relfile), 28),
830867
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)