diff options
| author | Georgios Andreadis <info@gandreadis.com> | 2020-06-24 13:26:56 +0200 |
|---|---|---|
| committer | Georgios Andreadis <info@gandreadis.com> | 2020-06-24 13:26:56 +0200 |
| commit | db979d36d0b9693cc81ffa0bdd29364c6218fc95 (patch) | |
| tree | 269c21d599ecd190a87e51775ef533b0ea847b56 /conftest.py | |
| parent | c7f773b027019086153f0260b507c8fa173ee5e8 (diff) | |
Add working test setup
Diffstat (limited to 'conftest.py')
| -rw-r--r-- | conftest.py | 13 |
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 |
