mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-31 06:48:25 -04:00
feat: Add bottle webserver to run along with tests
This commit is contained in:
parent
5b571aa166
commit
bf417f50a4
4 changed files with 28 additions and 0 deletions
tests
19
tests/conftest.py
Normal file
19
tests/conftest.py
Normal 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()
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue