# Path: pypi_portal/extensions.py
# LOG = getLogger(__name__)
# def _on_connect(dbapi_connection, **_):
# 
# Path: pypi_portal/models/pypi.py
# class Package(Base):
#     """Holds all of the packages on PyPI."""
#     name = Column(String(255), unique=True, nullable=False)
#     summary = Column(Text, nullable=False)
#     latest_version = Column(String(128), nullable=False)


import pytest
from pypi_portal.extensions import db
from pypi_portal.models.pypi import Package



@pytest.fixture
def drop_table():
    """Drops the pypi.Package table from the database."""
    Package.query.delete()  # Drop all rows.
    db.session.commit()
    Package.__table__.drop(db.engine)  # Drop the table.

# Path: pypi_portal/extensions.py
# LOG = getLogger(__name__)
# def _on_connect(dbapi_connection, **_):
# 
# Path: pypi_portal/models/pypi.py
# class Package(Base):
#     """Holds all of the packages on PyPI."""
#     name = Column(String(255), unique=True, nullable=False)
#     summary = Column(Text, nullable=False)
#     latest_version = Column(String(128), nullable=False)


# Path: tests/tasks/conftest.py
import pytest
from pypi_portal.extensions import db
from pypi_portal.models.pypi import Package




@pytest.fixture
def drop_table():
    """Drops the pypi.Package table from the database."""
    Package.query.delete()  # Drop all rows.
    db.session.commit()
    Package.__table__.drop(db.engine)  # Drop the table.

    db.session.commit()