Skip to content

Commit

Permalink
Move test inside package
Browse files Browse the repository at this point in the history
  • Loading branch information
robmoorman committed Nov 23, 2016
1 parent 7e35093 commit bbd1e27
Show file tree
Hide file tree
Showing 18 changed files with 17 additions and 24 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Expand Up @@ -7,6 +7,7 @@ install:
- pip install coveralls
- pip install -e .[test]
script:
- python -m py.test --cov=src/wagtailbakery --cov-report=xml tests/
- pytest --cov=wagtailbakery --cov-report=xml
- flake8 src/
after_success:
- coveralls
9 changes: 5 additions & 4 deletions Makefile
Expand Up @@ -3,21 +3,22 @@
all: install clean test lint docs

clean:
find . -name '*.pyc' | xargs rm
find . -type f -name "*.py[co]" -delete
find . -type d -name "__pycache__" -delete

docs:
cd docs && make clean && make html

flake8:
flake8 src/ tests/
flake8 src/

install:
pip install -e .[docs,test]

isort:
isort --check-only --diff --recursive src/ tests/
isort --check-only --diff --recursive src/

lint: flake8 isort

test:
python -m py.test tests/
pytest
6 changes: 4 additions & 2 deletions setup.cfg
@@ -1,3 +1,6 @@
[coverage:run]
omit=src/wagtailbakery/tests/*

[isort]
line_length=80

Expand All @@ -6,8 +9,7 @@ exclude=src/wagtailbakery/migrations/
max-line-length=80

[tool:pytest]
DJANGO_SETTINGS_MODULE=tests.settings
django_find_project=false
DJANGO_SETTINGS_MODULE=wagtailbakery.tests.settings

[wheel]
universal=1
File renamed without changes.
1 change: 1 addition & 0 deletions src/wagtailbakery/tests/conftest.py
@@ -0,0 +1 @@
pytest_plugins = 'wagtailbakery.tests.fixtures'
2 changes: 2 additions & 0 deletions src/wagtailbakery/tests/factories/__init__.py
@@ -0,0 +1,2 @@
from wagtailbakery.tests.factories.page import * # noqa
from wagtailbakery.tests.factories.site import * # noqa
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions tests/fixtures.py → src/wagtailbakery/tests/fixtures.py
@@ -1,9 +1,8 @@
import pytest

from wagtail.wagtailcore.models import Page, Site

from tests.factories.page import PageFactory
from tests.factories.site import SiteFactory
from wagtailbakery.tests.factories.page import PageFactory
from wagtailbakery.tests.factories.site import SiteFactory


@pytest.fixture
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 1 addition & 3 deletions tests/settings.py → src/wagtailbakery/tests/settings.py
Expand Up @@ -40,8 +40,6 @@

'bakery',
'wagtailbakery',

'tests',
]

LANGUAGES = [
Expand Down Expand Up @@ -76,7 +74,7 @@
'django.contrib.auth.hashers.MD5PasswordHasher',
)

ROOT_URLCONF = 'tests.urls'
ROOT_URLCONF = 'wagtailbakery.tests.urls'

SECRET_KEY = '7b&ova34-9b(dj$gevm65$lc!m3#^#g1z*v#gv-g8k0wlo7#l8'

Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion tests/conftest.py

This file was deleted.

1 change: 0 additions & 1 deletion tests/factories/__init__.py

This file was deleted.

9 changes: 0 additions & 9 deletions tests/templates/wagtailcore/page_detail.html

This file was deleted.

Empty file removed tests/unit/__init__.py
Empty file.

0 comments on commit bbd1e27

Please sign in to comment.