Skip to content

Commit

Permalink
green, please
Browse files Browse the repository at this point in the history
  • Loading branch information
austin3dickey committed Jan 23, 2025
1 parent 4b628dc commit d5dcc4f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,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 @@ -224,13 +226,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 @@ -263,7 +265,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 @@ -290,7 +294,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
Original file line number Diff line number Diff line change
Expand Up @@ -302,13 +302,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

0 comments on commit d5dcc4f

Please sign in to comment.