Skip to content

Commit 69991b7

Browse files
committed
test: add port option to pytest
1 parent 4c7b912 commit 69991b7

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/conftest.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
"""Shared test configuration for BalatroBot tests."""
2+
3+
import pytest
4+
5+
6+
def pytest_addoption(parser):
7+
"""Add command line options for pytest."""
8+
parser.addoption(
9+
"--port",
10+
action="store",
11+
default=12346,
12+
type=int,
13+
help="Port number for TCP connection (default: 12346)",
14+
)
15+
16+
17+
@pytest.fixture(scope="session")
18+
def port(request):
19+
"""Get the port number from command line option."""
20+
return request.config.getoption("--port")

0 commit comments

Comments
 (0)