Skip to content

Commit d4bc0c4

Browse files
committed
Some cleanup on integration test refactor; skip port for ipc
1 parent 5f290bb commit d4bc0c4

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

tests/integration/common.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313

1414

1515
class MiscWebSocketTest:
16-
def test_websocket_max_size_error(self, w3, endpoint_uri):
17-
w3 = Web3(
16+
def test_websocket_max_size_error(self, w3):
17+
w3_ = Web3(
1818
Web3.LegacyWebSocketProvider(
19-
endpoint_uri=endpoint_uri, websocket_kwargs={"max_size": 1}
19+
endpoint_uri=w3.provider.endpoint_uri, websocket_kwargs={"max_size": 1}
2020
)
2121
)
2222
with pytest.raises((OSError, ConnectionClosed)):
23-
w3.eth.get_block(0)
23+
w3_.eth.get_block(0)

tests/integration/go_ethereum/conftest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,10 @@ def wait_for_port(proc, timeout=10):
142142
line = proc.stderr.readline()
143143
if not line:
144144
continue
145-
146-
if match := re.compile(r"127\.0\.0\.1:(\d+)").search(line):
145+
elif "geth.ipc" in line:
146+
# ipc path will be retrieved via ``get_ipc_path()`` fixture
147+
return None
148+
elif match := re.compile(r"127\.0\.0\.1:(\d+)").search(line):
147149
port = int(match.group(1))
148150
if port not in {0, 80}:
149151
# remove false positive matches

tests/integration/go_ethereum/test_goethereum_http.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,10 @@ class TestGoEthereumAsyncNetModuleTest(GoEthereumAsyncNetModuleTest):
166166

167167
class TestGoEthereumAsyncEthModuleTest(GoEthereumAsyncEthModuleTest):
168168
@pytest.mark.asyncio
169-
async def test_async_http_provider_disconnects_gracefully(
170-
self, async_w3, endpoint_uri
171-
) -> None:
169+
async def test_async_http_provider_disconnects_gracefully(self, async_w3) -> None:
172170
w3_1 = async_w3
173171

174-
w3_2 = AsyncWeb3(AsyncHTTPProvider(endpoint_uri))
172+
w3_2 = AsyncWeb3(AsyncHTTPProvider(async_w3.provider.endpoint_uri))
175173
assert w3_1 != w3_2
176174

177175
await w3_1.eth.get_block("latest")

0 commit comments

Comments
 (0)