Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 0 additions & 51 deletions .github/workflows/stale-prs.yml

This file was deleted.

40 changes: 24 additions & 16 deletions python_files/tests/pytestadapter/test_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,17 @@ def test_pytest_collect(file, expected_const):
if actual_list is not None:
actual_item = actual_list.pop(0)
assert all(item in actual_item for item in ("status", "cwd", "error"))
assert (
actual_item.get("status") == "success"
), f"Status is not 'success', error is: {actual_item.get('error')}"
assert actual_item.get("status") == "success", (
f"Status is not 'success', error is: {actual_item.get('error')}"
)
assert actual_item.get("cwd") == os.fspath(helpers.TEST_DATA_PATH)
assert is_same_tree(
actual_item.get("tests"),
expected_const,
["id_", "lineno", "name", "runID"],
), 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)}"
), (
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)}"
)


@pytest.mark.skipif(
Expand Down Expand Up @@ -232,13 +234,13 @@ def test_symlink_root_dir():
actual_item = actual_list.pop(0)
try:
# Check if all requirements
assert all(
item in actual_item for item in ("status", "cwd", "error")
), "Required keys are missing"
assert all(item in actual_item for item in ("status", "cwd", "error")), (
"Required keys are missing"
)
assert actual_item.get("status") == "success", "Status is not 'success'"
assert actual_item.get("cwd") == os.fspath(
destination
), f"CWD does not match: {os.fspath(destination)}"
assert actual_item.get("cwd") == os.fspath(destination), (
f"CWD does not match: {os.fspath(destination)}"
)
assert actual_item.get("tests") == expected, "Tests do not match expected value"
except AssertionError as e:
# Print the actual_item in JSON format if an assertion fails
Expand Down Expand Up @@ -271,7 +273,9 @@ def test_pytest_root_dir():
actual_item.get("tests"),
expected_discovery_test_output.root_with_config_expected_output,
["id_", "lineno", "name", "runID"],
), 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)}"
), (
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)}"
)


def test_pytest_config_file():
Expand All @@ -298,7 +302,9 @@ def test_pytest_config_file():
actual_item.get("tests"),
expected_discovery_test_output.root_with_config_expected_output,
["id_", "lineno", "name", "runID"],
), 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)}"
), (
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)}"
)


def test_config_sub_folder():
Expand Down Expand Up @@ -347,12 +353,14 @@ def test_ruff_plugin():
if actual_list is not None:
actual_item = actual_list.pop(0)
assert all(item in actual_item for item in ("status", "cwd", "error"))
assert (
actual_item.get("status") == "success"
), f"Status is not 'success', error is: {actual_item.get('error')}"
assert actual_item.get("status") == "success", (
f"Status is not 'success', error is: {actual_item.get('error')}"
)
assert actual_item.get("cwd") == os.fspath(helpers.TEST_DATA_PATH)
assert is_same_tree(
actual_item.get("tests"),
expected_discovery_test_output.ruff_test_expected_output,
["id_", "lineno", "name", "runID"],
), 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)}"
), (
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)}"
)
12 changes: 6 additions & 6 deletions python_files/tests/pytestadapter/test_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,13 @@ def test_symlink_run():
actual_item = actual_list.pop(0)
try:
# Check if all requirements
assert all(
item in actual_item for item in ("status", "cwd", "result")
), "Required keys are missing"
assert all(item in actual_item for item in ("status", "cwd", "result")), (
"Required keys are missing"
)
assert actual_item.get("status") == "success", "Status is not 'success'"
assert actual_item.get("cwd") == os.fspath(
destination
), f"CWD does not match: {os.fspath(destination)}"
assert actual_item.get("cwd") == os.fspath(destination), (
f"CWD does not match: {os.fspath(destination)}"
)
actual_result_dict = {}
actual_result_dict.update(actual_item["result"])
assert actual_result_dict == expected_const
Expand Down
6 changes: 3 additions & 3 deletions python_files/tests/unittestadapter/test_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,9 @@ def test_simple_django_collect():
if actual_list is not None:
actual_item = actual_list.pop(0)
assert all(item in actual_item for item in ("status", "cwd"))
assert (
actual_item.get("status") == "success"
), f"Status is not 'success', error is: {actual_item.get('error')}"
assert actual_item.get("status") == "success", (
f"Status is not 'success', error is: {actual_item.get('error')}"
)
assert actual_item.get("cwd") == os.fspath(data_path)
assert len(actual_item["tests"]["children"]) == 1
assert actual_item["tests"]["children"][0]["children"][0]["id_"] == os.fsdecode(
Expand Down
Loading