Skip to content

Commit 8681cd4

Browse files
committed
tests: Fix socat install for macos on github actions.
1 parent 4c95b57 commit 8681cd4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/conftest.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import argparse
22
import logging.config
33
import os
4+
import platform
45
import shutil
56
import subprocess
67
import time
@@ -31,7 +32,13 @@
3132

3233
# Install the socat package if running as a Github Action.
3334
if os.getenv("GITHUB_ACTIONS"):
34-
subprocess.run("sudo apt-get install socat".split(), check=True)
35+
osname = platform.system()
36+
if osname == "Linux":
37+
subprocess.run("sudo apt-get install socat".split(), check=True)
38+
elif osname == "Darwin":
39+
subprocess.run("brew install socat".split(), check=True)
40+
elif osname == "Windows":
41+
raise RuntimeError("socat is not supported on Windows.")
3542

3643

3744
def pytest_addoption(parser: argparse.Namespace) -> None:

0 commit comments

Comments
 (0)