summaryrefslogtreecommitdiff
path: root/test/testutil.py
diff options
context:
space:
mode:
authorJeff Widman <jeff@jeffwidman.com>2018-10-27 00:11:10 -0700
committerJeff Widman <jeff@jeffwidman.com>2018-10-27 02:17:23 -0700
commitf00016e7cec64cfc9697b233809cd37e0e19cc64 (patch)
tree37d1d290b86c1e8e97776c1bd344261743cc04e4 /test/testutil.py
parent1945ad16a15f53a07fae489b20ac616bb184ca89 (diff)
downloadkafka-python-f00016e7cec64cfc9697b233809cd37e0e19cc64.tar.gz
Cleanup fixture imports
`random_string` now comes from `test.fixtures` and was being transparently imported via `test.testutil` so this bypasses the pointless indirect import. Similarly, `kafka_version` was transparently imported by `test.testutil` from `test.fixtures`. Also removed `random_port()` in `test.testutil` because its unused as its been replaced by the one in `test.fixtures`. This is part of the pytest migration that was started back in a1869c4be5f47b4f6433610249aaf29af4ec95e5.
Diffstat (limited to 'test/testutil.py')
-rw-r--r--test/testutil.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/test/testutil.py b/test/testutil.py
index a1383a0..feb6f6d 100644
--- a/test/testutil.py
+++ b/test/testutil.py
@@ -19,6 +19,7 @@ from kafka.errors import (
from kafka.structs import OffsetRequestPayload, ProduceRequestPayload
from test.fixtures import random_string, version_str_to_list, version as kafka_version #pylint: disable=wrong-import-order
+
def kafka_versions(*versions):
def construct_lambda(s):
@@ -65,12 +66,6 @@ def kafka_versions(*versions):
return real_kafka_versions
-def get_open_port():
- sock = socket.socket()
- sock.bind(("", 0))
- port = sock.getsockname()[1]
- sock.close()
- return port
_MESSAGES = {}
def msg(message):