Skip to content

Commit

Permalink
Dead fixtures check before runing tests (#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
nvo87 authored Nov 1, 2021
1 parent 5ed4672 commit be569c2
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 17 deletions.
1 change: 1 addition & 0 deletions {{cookiecutter.project_slug}}/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ lint:
flake8 src

test:
cd src && pytest --dead-fixtures
cd src && pytest -x
2 changes: 0 additions & 2 deletions {{cookiecutter.project_slug}}/src/app/fixtures/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from app.fixtures.api import as_anon
from app.fixtures.api import as_staff
from app.fixtures.api import as_user
from app.fixtures.factory import factory
from app.fixtures.image import uploaded_image
Expand All @@ -8,7 +7,6 @@
__all__ = [
'as_anon',
'as_user',
'as_staff',
'factory',
'uploaded_image',
'_temporary_media',
Expand Down
5 changes: 0 additions & 5 deletions {{cookiecutter.project_slug}}/src/app/fixtures/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,3 @@ def as_anon():
@pytest.fixture
def as_user(user):
return ApiClient(user=user)


@pytest.fixture
def as_staff(staff):
return ApiClient(user=staff)
10 changes: 0 additions & 10 deletions {{cookiecutter.project_slug}}/src/users/fixtures.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
import pytest


@pytest.fixture
def anon(factory):
return factory.anon()


@pytest.fixture
def user(factory):
return factory.user()


@pytest.fixture
def staff(factory):
return factory.user(is_staff=True)

0 comments on commit be569c2

Please sign in to comment.