Skip to content

Commit

Permalink
fix: remove deprecation warning and add single test
Browse files Browse the repository at this point in the history
  • Loading branch information
toadharvard committed Feb 17, 2024
1 parent 2a18a46 commit 11b47f4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,6 @@ warn_required_dynamic_aliases = true
[tool.ruff.lint]
fixable = ["ALL"]
ignore = ["F401"]

[tool.pytest.ini_options]
filterwarnings = ["ignore::DeprecationWarning"]
19 changes: 3 additions & 16 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,6 @@ def prepare_db():


@pytest.fixture(scope="session", autouse=True)
def get_test_session():
Session = sessionmaker(test_engine, expire_on_commit=False)
yield Session


@pytest.fixture(scope="function", autouse=True)
def clean_tables(request, get_test_session):
if "fixture_name" in request.fixturenames:
yield
else:
with get_test_session() as session:
for table_name in Base.metadata.tables.keys():
table = Base.metadata.tables[table_name]
session.query(table).delete()
session.commit()
yield
def session():
session = sessionmaker(test_engine, expire_on_commit=False)
yield session
2 changes: 2 additions & 0 deletions tests/test_true_is_true.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test_true_is_true():
assert True is True

0 comments on commit 11b47f4

Please sign in to comment.