From 9d0582b63c3b96f1c3707ab1de0e17830b870c1d Mon Sep 17 00:00:00 2001 From: Wayne Date: Thu, 11 Jul 2019 23:04:15 +0200 Subject: [PATCH] added server-fixture --- HelloWorld.py | 0 conftest.py | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+) delete mode 100644 HelloWorld.py create mode 100644 conftest.py diff --git a/HelloWorld.py b/HelloWorld.py deleted file mode 100644 index e69de29..0000000 diff --git a/conftest.py b/conftest.py new file mode 100644 index 0000000..343ff95 --- /dev/null +++ b/conftest.py @@ -0,0 +1,23 @@ +""" + setup the fixtures for our test +""" +import socketserver + +import pytest + + +@pytest.fixture() +def server(): + """ + starts the server + """ + from src.server import Handler_TCPServer + + HOST, PORT = "localhost", 9999 + + # Init the TCP server object, bind it to the localhost on 9999 port + tcp_server = socketserver.TCPServer((HOST, PORT), Handler_TCPServer) + + # Activate the TCP server. + # To abort the TCP server, press Ctrl-C. + tcp_server.serve_forever()