From beb4d8c5e4687245fe6d73207505e991ee32d618 Mon Sep 17 00:00:00 2001 From: eleanorjboyd Date: Thu, 21 Nov 2024 11:29:26 -0800 Subject: [PATCH] remove failing tests, update typing --- .../tests/pytestadapter/.data/test_forked.py | 17 ----------------- python_files/vscode_pytest/__init__.py | 3 ++- 2 files changed, 2 insertions(+), 18 deletions(-) delete mode 100644 python_files/tests/pytestadapter/.data/test_forked.py diff --git a/python_files/tests/pytestadapter/.data/test_forked.py b/python_files/tests/pytestadapter/.data/test_forked.py deleted file mode 100644 index 00b7b849a90e..000000000000 --- a/python_files/tests/pytestadapter/.data/test_forked.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. - -import pytest -import os - - -@pytest.mark.forked -def test_forked_process_p(): - pid = os.getpid() - print(f"Running in process with PID: {pid}") - assert True -@pytest.mark.forked -def test_forked_process_f(): - pid = os.getpid() - print(f"Running in process with PID: {pid}") - assert False diff --git a/python_files/vscode_pytest/__init__.py b/python_files/vscode_pytest/__init__.py index 8d5bab7dd5e1..94fde93143a1 100644 --- a/python_files/vscode_pytest/__init__.py +++ b/python_files/vscode_pytest/__init__.py @@ -69,7 +69,8 @@ def __init__(self, message): TEST_RUN_PIPE = os.getenv("TEST_RUN_PIPE") SYMLINK_PATH = None # Get variable set in the `run_pytest_script.py` for the parent process to check if its forked -ROOT_PROCESS_PID: int = os.getenv("PROCESS_ID") +process_id_envvar = os.getenv("PROCESS_ID") +ROOT_PROCESS_PID: int = int(process_id_envvar) if process_id_envvar else 0 def pytest_load_initial_conftests(early_config, parser, args): # noqa: ARG001