Skip to content

Commit 143f369

Browse files
committed
reformat
1 parent 141a0db commit 143f369

File tree

3 files changed

+27
-21
lines changed

3 files changed

+27
-21
lines changed

python_files/tests/pytestadapter/test_discovery.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,17 @@ def test_pytest_collect(file, expected_const):
195195
if actual_list is not None:
196196
actual_item = actual_list.pop(0)
197197
assert all(item in actual_item for item in ("status", "cwd", "error"))
198-
assert (
199-
actual_item.get("status") == "success"
200-
), f"Status is not 'success', error is: {actual_item.get('error')}"
198+
assert actual_item.get("status") == "success", (
199+
f"Status is not 'success', error is: {actual_item.get('error')}"
200+
)
201201
assert actual_item.get("cwd") == os.fspath(helpers.TEST_DATA_PATH)
202202
assert is_same_tree(
203203
actual_item.get("tests"),
204204
expected_const,
205205
["id_", "lineno", "name", "runID"],
206-
), f"Tests tree does not match expected value. \n Expected: {json.dumps(expected_const, indent=4)}. \n Actual: {json.dumps(actual_item.get('tests'), indent=4)}"
206+
), (
207+
f"Tests tree does not match expected value. \n Expected: {json.dumps(expected_const, indent=4)}. \n Actual: {json.dumps(actual_item.get('tests'), indent=4)}"
208+
)
207209

208210

209211
@pytest.mark.skipif(
@@ -232,13 +234,13 @@ def test_symlink_root_dir():
232234
actual_item = actual_list.pop(0)
233235
try:
234236
# Check if all requirements
235-
assert all(
236-
item in actual_item for item in ("status", "cwd", "error")
237-
), "Required keys are missing"
237+
assert all(item in actual_item for item in ("status", "cwd", "error")), (
238+
"Required keys are missing"
239+
)
238240
assert actual_item.get("status") == "success", "Status is not 'success'"
239-
assert actual_item.get("cwd") == os.fspath(
240-
destination
241-
), f"CWD does not match: {os.fspath(destination)}"
241+
assert actual_item.get("cwd") == os.fspath(destination), (
242+
f"CWD does not match: {os.fspath(destination)}"
243+
)
242244
assert actual_item.get("tests") == expected, "Tests do not match expected value"
243245
except AssertionError as e:
244246
# Print the actual_item in JSON format if an assertion fails
@@ -271,7 +273,9 @@ def test_pytest_root_dir():
271273
actual_item.get("tests"),
272274
expected_discovery_test_output.root_with_config_expected_output,
273275
["id_", "lineno", "name", "runID"],
274-
), f"Tests tree does not match expected value. \n Expected: {json.dumps(expected_discovery_test_output.root_with_config_expected_output, indent=4)}. \n Actual: {json.dumps(actual_item.get('tests'), indent=4)}"
276+
), (
277+
f"Tests tree does not match expected value. \n Expected: {json.dumps(expected_discovery_test_output.root_with_config_expected_output, indent=4)}. \n Actual: {json.dumps(actual_item.get('tests'), indent=4)}"
278+
)
275279

276280

277281
def test_pytest_config_file():
@@ -298,7 +302,9 @@ def test_pytest_config_file():
298302
actual_item.get("tests"),
299303
expected_discovery_test_output.root_with_config_expected_output,
300304
["id_", "lineno", "name", "runID"],
301-
), f"Tests tree does not match expected value. \n Expected: {json.dumps(expected_discovery_test_output.root_with_config_expected_output, indent=4)}. \n Actual: {json.dumps(actual_item.get('tests'), indent=4)}"
305+
), (
306+
f"Tests tree does not match expected value. \n Expected: {json.dumps(expected_discovery_test_output.root_with_config_expected_output, indent=4)}. \n Actual: {json.dumps(actual_item.get('tests'), indent=4)}"
307+
)
302308

303309

304310
def test_config_sub_folder():

python_files/tests/pytestadapter/test_execution.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,13 +258,13 @@ def test_symlink_run():
258258
actual_item = actual_list.pop(0)
259259
try:
260260
# Check if all requirements
261-
assert all(
262-
item in actual_item for item in ("status", "cwd", "result")
263-
), "Required keys are missing"
261+
assert all(item in actual_item for item in ("status", "cwd", "result")), (
262+
"Required keys are missing"
263+
)
264264
assert actual_item.get("status") == "success", "Status is not 'success'"
265-
assert actual_item.get("cwd") == os.fspath(
266-
destination
267-
), f"CWD does not match: {os.fspath(destination)}"
265+
assert actual_item.get("cwd") == os.fspath(destination), (
266+
f"CWD does not match: {os.fspath(destination)}"
267+
)
268268
actual_result_dict = {}
269269
actual_result_dict.update(actual_item["result"])
270270
assert actual_result_dict == expected_const

python_files/tests/unittestadapter/test_discovery.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,9 @@ def test_simple_django_collect():
314314
if actual_list is not None:
315315
actual_item = actual_list.pop(0)
316316
assert all(item in actual_item for item in ("status", "cwd"))
317-
assert (
318-
actual_item.get("status") == "success"
319-
), f"Status is not 'success', error is: {actual_item.get('error')}"
317+
assert actual_item.get("status") == "success", (
318+
f"Status is not 'success', error is: {actual_item.get('error')}"
319+
)
320320
assert actual_item.get("cwd") == os.fspath(data_path)
321321
assert len(actual_item["tests"]["children"]) == 1
322322
assert actual_item["tests"]["children"][0]["children"][0]["id_"] == os.fsdecode(

0 commit comments

Comments
 (0)