import pytest from tests.utils import db @pytest.fixture def db_fixture(request): """Creates and inserts a standard common db fixture Args: request (_pytest.python.SubRequest): a sub request for handling getting a fixture from a test function/fixture. """ db.exit_if_not_test_environment() db.create_log_table() def db_fixture_teardown(): db.drop_log_table() request.addfinalizer(db_fixture_teardown)