Skip to content

Commit

Permalink
Stopped importing from main
Browse files Browse the repository at this point in the history
  • Loading branch information
pachovit committed Aug 10, 2024
1 parent 94b9483 commit e370453
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions echopages/setup_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ def configure_backend(app: FastAPI) -> None:
app.include_router(api_endpoints.api_router)


def create_app() -> FastAPI:
def create_app(frontend: bool = True) -> FastAPI:
"""Create and configure the FastAPI app."""
app = FastAPI(title="EchoPages", description="Read, Repeat, Retain.")

configure_backend(app)
configure_frontend(app)
if frontend:
configure_frontend(app)

return app
3 changes: 2 additions & 1 deletion tests/functional/test_add_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
from httpx import Response
from pytest_bdd import given, parsers, scenario, then, when

from echopages.main import app
from echopages.setup_app import create_app

app = create_app(frontend=False)
client = TestClient(app)


Expand Down
3 changes: 2 additions & 1 deletion tests/functional/test_configure_digests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
from fastapi.testclient import TestClient
from pytest_bdd import given, scenario, then, when

from echopages.main import app
from echopages.setup_app import create_app

app = create_app(frontend=False)
client = TestClient(app)
host_url = "http://127.0.0.1:8000/api"

Expand Down
3 changes: 2 additions & 1 deletion tests/functional/test_trigger_digest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
from httpx import Response
from pytest_bdd import given, scenario, then, when

from echopages.main import app
from echopages.setup_app import create_app

app = create_app(frontend=False)
client = TestClient(app)
host_url = "http://127.0.0.1:8000/api"

Expand Down

0 comments on commit e370453

Please sign in to comment.