From db979d36d0b9693cc81ffa0bdd29364c6218fc95 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Wed, 24 Jun 2020 13:26:56 +0200 Subject: Add working test setup --- conftest.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 conftest.py (limited to 'conftest.py') diff --git a/conftest.py b/conftest.py new file mode 100644 index 00000000..1e404c1c --- /dev/null +++ b/conftest.py @@ -0,0 +1,13 @@ +import pytest + +from main import FLASK_CORE_APP + + +@pytest.fixture +def client(mocker): + """Returns a Flask API client to interact with.""" + FLASK_CORE_APP.config['TESTING'] = True + mocker.patch('opendc.util.database.DB') + + with FLASK_CORE_APP.test_client() as client: + yield client -- cgit v1.2.3