From 30836b15bcdfd3ea88ce7a15798602a4fc7d2aa9 Mon Sep 17 00:00:00 2001 From: Jakub Miazek Date: Fri, 4 Nov 2022 10:19:49 +0100 Subject: [PATCH] add coverage --- .github/workflows/build-and-test.yml | 6 +++++- app/models/nonsense.py | 5 ----- app/models/stuff.py | 4 ---- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 3e9edbb..407c9dc 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -44,7 +44,11 @@ jobs: if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' run: poetry install --no-interaction --no-root - name: Test with Coverage - run: poetry run pytest + run: poetry run pytest --cov=. --cov-report=xml + - uses: actions/upload-artifact@v3 + with: + name: coverage-xml + path: coverage.xml env: PYTHONDONTWRITEBYTECODE: 1 PYTHONUNBUFFERED: 1 diff --git a/app/models/nonsense.py b/app/models/nonsense.py index 929fc98..9a71a3b 100644 --- a/app/models/nonsense.py +++ b/app/models/nonsense.py @@ -17,11 +17,6 @@ class Nonsense(Base): name = Column(String, nullable=False, primary_key=True, unique=True) description = Column(String, nullable=False) - def __init__(self, name: str, description: str): - self.name = name - self.description = description - - @classmethod async def find(cls, db_session: AsyncSession, name: str): """ diff --git a/app/models/stuff.py b/app/models/stuff.py index ea1a2a2..fc7944a 100644 --- a/app/models/stuff.py +++ b/app/models/stuff.py @@ -17,10 +17,6 @@ class Stuff(Base): name = Column(String, nullable=False, primary_key=True, unique=True) description = Column(String, nullable=False) - def __init__(self, name: str, description: str): - self.name = name - self.description = description - @classmethod async def find(cls, db_session: AsyncSession, name: str): """