diff options
| author | Munyoki Kilyungi (aider) | 2025-02-05 12:22:10 +0300 |
|---|---|---|
| committer | BonfaceKilz | 2025-02-10 12:57:22 +0300 |
| commit | 007a54501693fe28c25513ce8391da919638384d (patch) | |
| tree | b8c60e2dc9463812caf976be0874c21a050bf9e6 /tests/unit/conftest.py | |
| parent | d799cecfba78e29ad6984cb5bcd4eb7c70edd3c6 (diff) | |
| download | genenetwork3-007a54501693fe28c25513ce8391da919638384d.tar.gz | |
feat: Add LMDB sample data retrieval API endpoint with tests
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'tests/unit/conftest.py')
| -rw-r--r-- | tests/unit/conftest.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/unit/conftest.py b/tests/unit/conftest.py index d9d5492..5526d16 100644 --- a/tests/unit/conftest.py +++ b/tests/unit/conftest.py @@ -7,6 +7,7 @@ import pytest from gn3.app import create_app + @pytest.fixture(scope="session") def fxtr_app(): """Fixture: setup the test app""" @@ -16,6 +17,11 @@ def fxtr_app(): f'testdb_{datetime.now().strftime("%Y%m%dT%H%M%S")}') app = create_app({ "TESTING": True, + "LMDB_DATA_PATH": str( + Path(__file__).parent.parent / + Path("test_data/lmdb-test-data") + ), + "AUTH_SERVER_URL": "http://127.0.0.1:8081", "OAUTH2_ACCESS_TOKEN_GENERATOR": "tests.unit.auth.test_token.gen_token" }) app.testing = True @@ -23,13 +29,15 @@ def fxtr_app(): # Clean up after ourselves testdb.unlink(missing_ok=True) + @pytest.fixture(scope="session") -def client(fxtr_app): # pylint: disable=redefined-outer-name +def client(fxtr_app): # pylint: disable=redefined-outer-name """Create a test client fixture for tests""" with fxtr_app.app_context(): yield fxtr_app.test_client() + @pytest.fixture(scope="session") -def fxtr_app_config(client): # pylint: disable=redefined-outer-name +def fxtr_app_config(client): # pylint: disable=redefined-outer-name """Return the test application's configuration object""" return client.application.config |
