Skip to content

Commit

Permalink
Add app fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
DMalone87 committed Oct 12, 2024
1 parent 4c0d3a8 commit 7c3a970
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions backend/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@ def db_session(test_db_driver):
yield session


@pytest.fixture(scope="session")
def app(test_db_driver):
app = create_app(config="testing")
# The app should be ready! Provide the app instance here.
# Use the app context to make testing easier.
# The main time where providing app context can cause false positives is
# when testing CLI commands that don't pass the app context.
with app.app_context():
yield app


# This function must be called for every new test node created
def add_test_label(node):
query = "MATCH (n) WHERE id(n) = $node_id SET n:TestData"
Expand Down

0 comments on commit 7c3a970

Please sign in to comment.