Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dead fixtures check before run tests #377

Merged
merged 9 commits into from
Nov 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
6 changes: 3 additions & 3 deletions {{cookiecutter.project_slug}}/dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ iniconfig==1.1.1
# via pytest
ipython-genutils==0.2.0
# via traitlets
ipython==7.28.0
ipython==7.29.0
# via -r dev-requirements.in
isort==5.9.3
# via flake8-isort
Expand All @@ -114,7 +114,7 @@ mccabe==0.6.1
# via flake8
mixer==7.2.0
# via -r dev-requirements.in
packaging==21.0
packaging==21.2
# via
# -c requirements.txt
# pytest
Expand Down Expand Up @@ -180,7 +180,7 @@ text-unidecode==1.3
# via faker
toml==0.10.2
# via pytest
traitlets==5.1.0
traitlets==5.1.1
# via
# ipython
# matplotlib-inline
Expand Down
4 changes: 2 additions & 2 deletions {{cookiecutter.project_slug}}/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ django-ipware==3.0.7
# via -r requirements.in
django-split-settings==1.1.0
# via -r requirements.in
django-storages==1.12.2
django-storages==1.12.3
# via -r requirements.in
django==3.2.8
# via
Expand Down Expand Up @@ -66,7 +66,7 @@ jinja2==3.0.2
# via coreschema
markupsafe==2.0.1
# via jinja2
packaging==21.0
packaging==21.2
# via drf-yasg
pillow==8.4.0
# via -r requirements.in
Expand Down
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)