diff --git a/README.rst b/README.rst index aff6cb009..99c3af5b6 100644 --- a/README.rst +++ b/README.rst @@ -44,7 +44,7 @@ in Google Groups. Tests ----- -The tests should run with tox and pytest. Running `tox` will run all tests for all environments. +The tests should run with tox. Running `tox` will run all tests for all environments. However, it is possible to run a certain environment with `tox -e `, a list of all environments can be found with `tox -l`. These tests require the dependencies of the different engines defined in the documentation. It is possible to install these dependencies into a vagrant image with the diff --git a/setup.cfg b/setup.cfg index 91550b6c7..82ceb5db4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -29,12 +29,3 @@ omit = */sorl-thumbnail/sorl/__init__.py [cov:report] exclude_lines = pragma: no cover if __name__ == .__main__.: - -;; The pytest framework - -[tool:pytest] -python_files = test_*.py *tests.py -norecursedirs = .* tmp* __pycache__ -testpaths = tests -django_find_project = false - diff --git a/tests/thumbnail_tests/test_alternative_resolutions.py b/tests/thumbnail_tests/test_alternative_resolutions.py index 8a27ffdcc..11fbd060b 100644 --- a/tests/thumbnail_tests/test_alternative_resolutions.py +++ b/tests/thumbnail_tests/test_alternative_resolutions.py @@ -1,7 +1,5 @@ import os -import pytest - from sorl.thumbnail import get_thumbnail from sorl.thumbnail.conf import settings from sorl.thumbnail.images import ImageFile @@ -10,9 +8,6 @@ from .utils import BaseStorageTestCase -pytestmark = pytest.mark.django_db - - class AlternativeResolutionsTest(BaseStorageTestCase): name = 'retina.jpg' diff --git a/tests/thumbnail_tests/test_backends.py b/tests/thumbnail_tests/test_backends.py index d20dd4516..62f50538e 100644 --- a/tests/thumbnail_tests/test_backends.py +++ b/tests/thumbnail_tests/test_backends.py @@ -6,7 +6,6 @@ import unittest from PIL import Image -import pytest from django.test import TestCase from django.test.utils import override_settings @@ -19,9 +18,6 @@ from .models import Item -pytestmark = pytest.mark.django_db - - class BackendTest(BaseTestCase): def test_delete(self): im1 = Item.objects.get(image='100x100.jpg').image diff --git a/tests/thumbnail_tests/test_commands.py b/tests/thumbnail_tests/test_commands.py index 41a1ded0b..c737e3391 100644 --- a/tests/thumbnail_tests/test_commands.py +++ b/tests/thumbnail_tests/test_commands.py @@ -1,7 +1,6 @@ from io import StringIO import os -import pytest from django.core import management from sorl.thumbnail.conf import settings @@ -9,9 +8,6 @@ from .utils import BaseTestCase -pytestmark = pytest.mark.django_db - - class CommandTests(BaseTestCase): def make_test_thumbnails(self, *sizes): item = Item.objects.get(image='500x500.jpg') diff --git a/tests/thumbnail_tests/test_engines.py b/tests/thumbnail_tests/test_engines.py index f3ef9e7a4..151e967ad 100644 --- a/tests/thumbnail_tests/test_engines.py +++ b/tests/thumbnail_tests/test_engines.py @@ -3,7 +3,6 @@ import unittest from subprocess import Popen, PIPE -import pytest from PIL import Image from django.core.files.storage import default_storage from django.template.loader import render_to_string @@ -20,9 +19,6 @@ from .utils import BaseTestCase -pytestmark = pytest.mark.django_db - - class SimpleTestCase(BaseTestCase): def test_simple(self): item = Item.objects.get(image='500x500.jpg') diff --git a/tests/thumbnail_tests/test_filters.py b/tests/thumbnail_tests/test_filters.py index 1e1acd6e3..763c0c935 100644 --- a/tests/thumbnail_tests/test_filters.py +++ b/tests/thumbnail_tests/test_filters.py @@ -1,12 +1,8 @@ -import pytest from django.template.loader import render_to_string from tests.thumbnail_tests.utils import BaseTestCase -pytestmark = pytest.mark.django_db - - class FilterTestCase(BaseTestCase): def test_html_filter(self): text = 'A image!' diff --git a/tests/thumbnail_tests/test_storage.py b/tests/thumbnail_tests/test_storage.py index e8b67feab..5a8684a64 100644 --- a/tests/thumbnail_tests/test_storage.py +++ b/tests/thumbnail_tests/test_storage.py @@ -1,5 +1,4 @@ import unittest -import pytest from sorl.thumbnail import get_thumbnail, default from sorl.thumbnail.helpers import get_module_class @@ -7,9 +6,6 @@ from .utils import BaseStorageTestCase -pytestmark = pytest.mark.django_db - - class StorageTestCase(BaseStorageTestCase): name = 'org.jpg' diff --git a/tests/thumbnail_tests/test_templatetags.py b/tests/thumbnail_tests/test_templatetags.py index 90ed5ebc0..9f7f82dbf 100644 --- a/tests/thumbnail_tests/test_templatetags.py +++ b/tests/thumbnail_tests/test_templatetags.py @@ -6,7 +6,6 @@ from django.template.loader import render_to_string from django.test import Client, TestCase from django.test.utils import override_settings -import pytest from sorl.thumbnail.conf import settings from sorl.thumbnail.engines.pil_engine import Engine as PILEngine @@ -14,9 +13,6 @@ from .utils import BaseTestCase, DATA_DIR -pytestmark = pytest.mark.django_db - - class TemplateTestCaseA(BaseTestCase): def test_model(self): item = Item.objects.get(image='500x500.jpg') diff --git a/tox.ini b/tox.ini index ff27ad5c4..36edcb984 100644 --- a/tox.ini +++ b/tox.ini @@ -29,9 +29,7 @@ envlist = [testenv] deps = - pytest - pytest-cov - pytest-django + coverage pillow redis: redis dynamodb: boto @@ -53,7 +51,9 @@ setenv = pgmagick: DJANGO_SETTINGS_MODULE=tests.settings.pgmagick dbm: DJANGO_SETTINGS_MODULE=tests.settings.dbm commands = - python -m pytest -rw --cov-append --cov-config setup.cfg --cov sorl --cov-report=xml {posargs:} + coverage run {envbindir}/django-admin test -v2 {posargs:} + coverage report -m + coverage xml [testenv:py38-qa] skip_install = True