1
0
mirror of https://github.com/pirate/ArchiveBox.git synced 2025-08-22 14:13:01 +02:00

feat: Add bottle webserver to run along with tests

This commit is contained in:
Cristian
2020-07-07 14:46:45 -05:00
parent 5b571aa166
commit bf417f50a4
4 changed files with 28 additions and 0 deletions

19
tests/conftest.py Normal file
View File

@@ -0,0 +1,19 @@
from multiprocessing import Process
import pytest
from .mock_server.server import start
server_process = None
@pytest.hookimpl
def pytest_sessionstart(session):
global server_process
server_process = Process(target=start)
server_process.start()
@pytest.hookimpl
def pytest_sessionfinish(session):
if server_process is not None:
server_process.terminate()
server_process.join()

View File

View File

@@ -0,0 +1,8 @@
from bottle import route, run
@route('/')
def index():
return "Hello"
def start():
run(host='localhost', port=8080)