Skip to content

Commit

Permalink
fix: failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
gablooge committed Apr 8, 2024
1 parent 8ca2d8e commit c655126
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion uselevers/bills/tests/test_models_bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def test_crud_bills(
# test update and delete
with db.begin():
created_bill = db.query(Bill).first()
assert created_bill is not None
# test update with valid total
new_total: float = 1.10
created_bill.total = new_total
Expand All @@ -68,7 +69,7 @@ def test_crud_bills(

def test_create_bill_with_invalid_total(
db: Annotated[Session, Depends(deps.get_db)], # noqa: F811
):
) -> None:
bill_create = BillSpec(
total=-1,
)
Expand Down
5 changes: 4 additions & 1 deletion uselevers/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# import os
from collections.abc import Generator
from urllib.parse import ParseResult, urlparse

Expand All @@ -24,7 +25,9 @@ def random_database_uri(original: str) -> ParseResult:
@pytest.fixture(scope="session")
def alembic_engine() -> Generator[Engine, None, None]:
# Configure a random database URI
sqlalchemy_new_uri = random_database_uri(str(settings.SQLALCHEMY_DATABASE_URI))
sqlalchemy_new_uri = urlparse(str(settings.SQLALCHEMY_DATABASE_URI))
# if os.getenv("GITHUB_ACTIONS") != "true":
# sqlalchemy_new_uri = random_database_uri(str(settings.SQLALCHEMY_DATABASE_URI))
sqlalchemy_database = sqlalchemy_new_uri.path.replace("/", "")

# Create an engine to connect to the default URL
Expand Down

0 comments on commit c655126

Please sign in to comment.