Skip to content

Commit

Permalink
changes to support pytest 8 (#22799)
Browse files Browse the repository at this point in the history
fixes: #22798
  • Loading branch information
eleanorjboyd authored Jan 29, 2024
1 parent 67ac41c commit c8c07a0
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 23 deletions.
22 changes: 11 additions & 11 deletions pythonFiles/tests/pytestadapter/expected_discovery_test_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@
# └── test_top_folder.py
# └── test_top_function_t
# └── test_top_function_f
# └── nested_folder_one
# └── z_nested_folder_one
# └── test_bottom_folder.py
# └── test_bottom_function_t
# └── test_bottom_function_f
Expand All @@ -326,14 +326,14 @@
TEST_DATA_PATH / "dual_level_nested_folder" / "test_top_folder.py"
)

test_nested_folder_one_path = (
TEST_DATA_PATH / "dual_level_nested_folder" / "nested_folder_one"
test_z_nested_folder_one_path = (
TEST_DATA_PATH / "dual_level_nested_folder" / "z_nested_folder_one"
)

test_bottom_folder_path = (
TEST_DATA_PATH
/ "dual_level_nested_folder"
/ "nested_folder_one"
/ "z_nested_folder_one"
/ "test_bottom_folder.py"
)

Expand Down Expand Up @@ -392,10 +392,10 @@
],
},
{
"name": "nested_folder_one",
"path": os.fspath(test_nested_folder_one_path),
"name": "z_nested_folder_one",
"path": os.fspath(test_z_nested_folder_one_path),
"type_": "folder",
"id_": os.fspath(test_nested_folder_one_path),
"id_": os.fspath(test_z_nested_folder_one_path),
"children": [
{
"name": "test_bottom_folder.py",
Expand All @@ -412,11 +412,11 @@
),
"type_": "test",
"id_": get_absolute_test_id(
"dual_level_nested_folder/nested_folder_one/test_bottom_folder.py::test_bottom_function_t",
"dual_level_nested_folder/z_nested_folder_one/test_bottom_folder.py::test_bottom_function_t",
test_bottom_folder_path,
),
"runID": get_absolute_test_id(
"dual_level_nested_folder/nested_folder_one/test_bottom_folder.py::test_bottom_function_t",
"dual_level_nested_folder/z_nested_folder_one/test_bottom_folder.py::test_bottom_function_t",
test_bottom_folder_path,
),
},
Expand All @@ -429,11 +429,11 @@
),
"type_": "test",
"id_": get_absolute_test_id(
"dual_level_nested_folder/nested_folder_one/test_bottom_folder.py::test_bottom_function_f",
"dual_level_nested_folder/z_nested_folder_one/test_bottom_folder.py::test_bottom_function_f",
test_bottom_folder_path,
),
"runID": get_absolute_test_id(
"dual_level_nested_folder/nested_folder_one/test_bottom_folder.py::test_bottom_function_f",
"dual_level_nested_folder/z_nested_folder_one/test_bottom_folder.py::test_bottom_function_f",
test_bottom_folder_path,
),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@
# └── test_top_folder.py
# └── test_top_function_t: success
# └── test_top_function_f: failure
# └── nested_folder_one
# └── z_nested_folder_one
# └── test_bottom_folder.py
# └── test_bottom_function_t: success
# └── test_bottom_function_f: failure
Expand All @@ -318,7 +318,7 @@
dual_level_nested_folder_bottom_path = (
TEST_DATA_PATH
/ "dual_level_nested_folder"
/ "nested_folder_one"
/ "z_nested_folder_one"
/ "test_bottom_folder.py"
)
dual_level_nested_folder_execution_expected_output = {
Expand All @@ -345,11 +345,11 @@
"subtest": None,
},
get_absolute_test_id(
"nested_folder_one/test_bottom_folder.py::test_bottom_function_t",
"z_nested_folder_one/test_bottom_folder.py::test_bottom_function_t",
dual_level_nested_folder_bottom_path,
): {
"test": get_absolute_test_id(
"nested_folder_one/test_bottom_folder.py::test_bottom_function_t",
"z_nested_folder_one/test_bottom_folder.py::test_bottom_function_t",
dual_level_nested_folder_bottom_path,
),
"outcome": "success",
Expand All @@ -358,11 +358,11 @@
"subtest": None,
},
get_absolute_test_id(
"nested_folder_one/test_bottom_folder.py::test_bottom_function_f",
"z_nested_folder_one/test_bottom_folder.py::test_bottom_function_f",
dual_level_nested_folder_bottom_path,
): {
"test": get_absolute_test_id(
"nested_folder_one/test_bottom_folder.py::test_bottom_function_f",
"z_nested_folder_one/test_bottom_folder.py::test_bottom_function_f",
dual_level_nested_folder_bottom_path,
),
"outcome": "failure",
Expand Down Expand Up @@ -479,7 +479,7 @@
dual_level_nested_folder_bottom_path = (
TEST_DATA_PATH
/ "dual_level_nested_folder"
/ "nested_folder_one"
/ "z_nested_folder_one"
/ "test_bottom_folder.py"
)
unittest_folder_add_path = TEST_DATA_PATH / "unittest_folder" / "test_add.py"
Expand Down
3 changes: 1 addition & 2 deletions pythonFiles/tests/pytestadapter/test_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,7 @@ def test_pytest_config_file():
actual = runner_with_cwd(
[
"--collect-only",
"-c",
"tests/pytest.ini",
"tests/",
],
TEST_DATA_PATH / "root",
)
Expand Down
4 changes: 2 additions & 2 deletions pythonFiles/tests/pytestadapter/test_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ def test_bad_id_error_execution():
[
"dual_level_nested_folder/test_top_folder.py::test_top_function_t",
"dual_level_nested_folder/test_top_folder.py::test_top_function_f",
"dual_level_nested_folder/nested_folder_one/test_bottom_folder.py::test_bottom_function_t",
"dual_level_nested_folder/nested_folder_one/test_bottom_folder.py::test_bottom_function_f",
"dual_level_nested_folder/z_nested_folder_one/test_bottom_folder.py::test_bottom_function_t",
"dual_level_nested_folder/z_nested_folder_one/test_bottom_folder.py::test_bottom_function_f",
],
expected_execution_test_output.dual_level_nested_folder_execution_expected_output,
),
Expand Down
2 changes: 1 addition & 1 deletion pythonFiles/vscode_pytest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ def create_session_node(session: pytest.Session) -> TestNode:
"""
node_path = get_node_path(session)
return {
"name": session.name,
"name": node_path.name,
"path": node_path,
"type_": "folder",
"children": [],
Expand Down

0 comments on commit c8c07a0

Please sign in to comment.