summaryrefslogtreecommitdiff
path: root/conftest.py
diff options
context:
space:
mode:
authorGeorgios Andreadis <info@gandreadis.com>2020-06-24 13:26:56 +0200
committerGeorgios Andreadis <info@gandreadis.com>2020-06-24 13:26:56 +0200
commitdb979d36d0b9693cc81ffa0bdd29364c6218fc95 (patch)
tree269c21d599ecd190a87e51775ef533b0ea847b56 /conftest.py
parentc7f773b027019086153f0260b507c8fa173ee5e8 (diff)
Add working test setup
Diffstat (limited to 'conftest.py')
-rw-r--r--conftest.py13
1 files changed, 13 insertions, 0 deletions
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