Skip to content

Commit

Permalink
#150: Add pytest fixtures for filter testing
Browse files Browse the repository at this point in the history
- Since they're placed in conftest.py, pytest will automatically pick these up, they don't need to be imported into the places I use them in
  • Loading branch information
MRichards99 committed Nov 11, 2020
1 parent 572e89c commit 71720d0
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from icat.client import Client
from icat.query import Query
import pytest

from datagateway_api.common.config import config


@pytest.fixture(scope="package")
def icat_client():
client = Client(config.get_icat_url(), checkCert=config.get_icat_check_cert())
client.login(config.get_test_mechanism(), config.get_test_user_credentials())
print(f"ID: {client.sessionId}")
return client


@pytest.fixture()
def icat_query(icat_client):
query = Query(icat_client, "Investigation")

return query

0 comments on commit 71720d0

Please sign in to comment.