55exactly mirroring the behavior of the original test_solc.sh script.
66"""
77
8+ from .conftest import run_command
9+
810
911class TestCompilerVersions :
1012 """Test compilation with different Solidity compiler versions."""
1113
12- def test_solc_045 (self , run_command , test_contracts_dir , isolated_solc_data ):
14+ def test_solc_045 (self , test_contracts_dir , isolated_solc_data ):
1315 """Test Solidity 0.4.5 compilation behavior."""
1416 # Switch to 0.4.5
1517 result = run_command ("solc-select use 0.4.5 --always-install" , check = False )
@@ -26,7 +28,7 @@ def test_solc_045(self, run_command, test_contracts_dir, isolated_solc_data):
2628 f"solc045_fail_compile did not fail as expected. Output: { result .stdout } "
2729 )
2830
29- def test_solc_050 (self , run_command , test_contracts_dir , isolated_solc_data ):
31+ def test_solc_050 (self , test_contracts_dir , isolated_solc_data ):
3032 """Test Solidity 0.5.0 compilation behavior."""
3133 # Switch to 0.5.0
3234 result = run_command ("solc-select use 0.5.0 --always-install" , check = False )
@@ -44,7 +46,7 @@ def test_solc_050(self, run_command, test_contracts_dir, isolated_solc_data):
4446 in result .stdout
4547 ), f"solc050_fail_compile did not fail as expected. Output: { result .stdout } "
4648
47- def test_solc_060 (self , run_command , test_contracts_dir , isolated_solc_data ):
49+ def test_solc_060 (self , test_contracts_dir , isolated_solc_data ):
4850 """Test Solidity 0.6.0 compilation behavior."""
4951 # Switch to 0.6.0
5052 result = run_command ("solc-select use 0.6.0 --always-install" , check = False )
@@ -58,7 +60,7 @@ def test_solc_060(self, run_command, test_contracts_dir, isolated_solc_data):
5860 result = run_command (f"solc { test_contracts_dir } /solc060_success_receive.sol" , check = False )
5961 assert result .returncode == 0 , f"solc060_success_receive failed with: { result .stdout } "
6062
61- def test_solc_070 (self , run_command , test_contracts_dir , isolated_solc_data ):
63+ def test_solc_070 (self , test_contracts_dir , isolated_solc_data ):
6264 """Test Solidity 0.7.0 compilation behavior."""
6365 # Switch to 0.7.0
6466 result = run_command ("solc-select use 0.7.0 --always-install" , check = False )
@@ -75,7 +77,7 @@ def test_solc_070(self, run_command, test_contracts_dir, isolated_solc_data):
7577 result = run_command (f"solc { test_contracts_dir } /solc070_success.sol" , check = False )
7678 assert result .returncode == 0 , f"solc070_success failed with: { result .stdout } "
7779
78- def test_solc_080 (self , run_command , test_contracts_dir , isolated_solc_data ):
80+ def test_solc_080 (self , test_contracts_dir , isolated_solc_data ):
7981 """Test Solidity 0.8.0 compilation behavior."""
8082 # Switch to 0.8.0
8183 result = run_command ("solc-select use 0.8.0 --always-install" , check = False )
@@ -104,7 +106,7 @@ def test_solc_080(self, run_command, test_contracts_dir, isolated_solc_data):
104106class TestVersionSwitching :
105107 """Test version switching functionality."""
106108
107- def test_always_install_flag (self , run_command , isolated_solc_data ):
109+ def test_always_install_flag (self , isolated_solc_data ):
108110 """Test --always-install flag functionality."""
109111 # In isolated environment, 0.8.9 won't be installed initially
110112 # No need for complex path validation or manual cleanup
@@ -116,7 +118,7 @@ def test_always_install_flag(self, run_command, isolated_solc_data):
116118 f"Failed to switch with --always-install. Output: { result .stdout } "
117119 )
118120
119- def test_use_without_install (self , run_command , isolated_solc_data ):
121+ def test_use_without_install (self , isolated_solc_data ):
120122 """Test that 'use' fails when version is not installed."""
121123 # In isolated environment, 0.8.1 won't be installed initially
122124 # No need for complex cleanup logic
0 commit comments