@@ -68,68 +68,6 @@ def isolated_python_env(tmp_path):
6868 }
6969
7070
71- def run_in_venv (
72- venv_info : Dict , cmd : str , check : bool = True , ** kwargs
73- ) -> subprocess .CompletedProcess :
74- """
75- Run a command in an isolated virtual environment.
76-
77- Args:
78- venv_info: Dictionary from isolated_python_env fixture
79- cmd: Command to run
80- check: Whether to raise on non-zero exit code
81- **kwargs: Additional arguments to subprocess.run
82-
83- Returns:
84- CompletedProcess instance with stdout, stderr, and returncode
85- """
86- env = os .environ .copy ()
87- env .update (venv_info ["env" ])
88-
89- try :
90- return subprocess .run (
91- cmd , shell = True , env = env , capture_output = True , text = True , check = check , ** kwargs
92- )
93- except subprocess .CalledProcessError as e :
94- print ("Command failed with CalledProcessError." )
95- print ("Exit code:" , e .returncode )
96- print ("Command:" , e .cmd )
97- print ("Stdout:" , e .stdout )
98- print ("Stderr:" , e .stderr )
99- raise
100-
101-
102- def run_command (
103- cmd : str , check : bool = True , capture_stderr : bool = True
104- ) -> subprocess .CompletedProcess :
105- """
106- Execute shell commands and return output.
107-
108- This function is kept for backward compatibility with tests using isolated_solc_data.
109- For tests using isolated_python_env, use run_in_venv instead.
110-
111- Args:
112- cmd: Command to run
113- check: Whether to raise on non-zero exit code
114- capture_stderr: Whether to capture stderr
115-
116- Returns:
117- CompletedProcess instance with stdout, stderr, and returncode
118- """
119- stderr_setting = subprocess .STDOUT if capture_stderr else subprocess .PIPE
120-
121- result = subprocess .run (
122- cmd ,
123- shell = True ,
124- capture_output = False ,
125- stdout = subprocess .PIPE ,
126- stderr = stderr_setting ,
127- text = True ,
128- check = check ,
129- )
130- return result
131-
132-
13371@pytest .fixture (scope = "session" )
13472def test_contracts_dir () -> Path :
13573 """Path to test Solidity contracts."""
0 commit comments