Skip to content

Commit 01d9301

Browse files
authored
Merge branch 'main' into conda_bug1
2 parents 49efcd2 + e772738 commit 01d9301

File tree

4 files changed

+33
-76
lines changed

4 files changed

+33
-76
lines changed

.github/workflows/stale-prs.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

python_files/tests/pytestadapter/test_discovery.py

Lines changed: 24 additions & 16 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():
@@ -347,12 +353,14 @@ def test_ruff_plugin():
347353
if actual_list is not None:
348354
actual_item = actual_list.pop(0)
349355
assert all(item in actual_item for item in ("status", "cwd", "error"))
350-
assert (
351-
actual_item.get("status") == "success"
352-
), f"Status is not 'success', error is: {actual_item.get('error')}"
356+
assert actual_item.get("status") == "success", (
357+
f"Status is not 'success', error is: {actual_item.get('error')}"
358+
)
353359
assert actual_item.get("cwd") == os.fspath(helpers.TEST_DATA_PATH)
354360
assert is_same_tree(
355361
actual_item.get("tests"),
356362
expected_discovery_test_output.ruff_test_expected_output,
357363
["id_", "lineno", "name", "runID"],
358-
), f"Tests tree does not match expected value. \n Expected: {json.dumps(expected_discovery_test_output.ruff_test_expected_output, indent=4)}. \n Actual: {json.dumps(actual_item.get('tests'), indent=4)}"
364+
), (
365+
f"Tests tree does not match expected value. \n Expected: {json.dumps(expected_discovery_test_output.ruff_test_expected_output, indent=4)}. \n Actual: {json.dumps(actual_item.get('tests'), indent=4)}"
366+
)

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)