Skip to content

Commit 063d1bd

Browse files
Merge pull request #1938 from Bastian-Krause/bst/netns-test-fixes
tests/test_netns: define test dependencies
2 parents 4084c8e + f155b06 commit 063d1bd

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ dev = [
9292
"pylint>=3.0.0",
9393
"ruff>=0.5.7",
9494
"pystuck",
95+
"requests[socks]>=2.26.0",
9596

9697
# GRPC Channelz support
9798
"grpcio-channelz>=1.64.1, <2.0.0",

tests/test_netns.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import socket
55
import subprocess
66
import time
7+
from shutil import which
78

89
import pytest
910

@@ -136,7 +137,11 @@ def test_detach(netns):
136137
assert netns._agent.list_sockets() == []
137138

138139

140+
@pytest.mark.skipif(not which("microsocks"), reason="microsocks not available")
139141
def test_socks(netns, tmp_path):
142+
# installed via requests[socks]
143+
pytest.importorskip("socks")
144+
140145
with contextlib.ExitStack() as stack:
141146
(port, password) = stack.enter_context(netns.socks_proxy())
142147

0 commit comments

Comments
 (0)