]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Simplify statsport fixture in statschannel test
authorTom Krizek <tkrizek@isc.org>
Mon, 27 Nov 2023 12:28:27 +0000 (13:28 +0100)
committerTom Krizek <tkrizek@isc.org>
Tue, 5 Dec 2023 13:27:41 +0000 (14:27 +0100)
The ports fixture provides the required port numbers already and there's
no need to get the port number from environment.

(cherry picked from commit f0481c8600b0752f9d9029b3d20ddb85976fa9da)

bin/tests/system/statschannel/conftest.py

index 363dd7ad1bf8d8c7c92b2c360a6225eb1f1035ea..c26935b0ab2db4a1a9fcd98a0a9bc3f94eb6a48f 100644 (file)
@@ -9,17 +9,9 @@
 # See the COPYRIGHT file distributed with this work for additional
 # information regarding copyright ownership.
 
-import os
 import pytest
 
 
-@pytest.fixture
-def statsport(request):
-    # pylint: disable=unused-argument
-    env_port = os.getenv("EXTRAPORT1")
-    if env_port is None:
-        env_port = 5301
-    else:
-        env_port = int(env_port)
-
-    return env_port
+@pytest.fixture(scope="module")
+def statsport(ports):
+    return ports["EXTRAPORT1"]