Skip to content

Commit

Permalink
Run tests with standard django-admin
Browse files Browse the repository at this point in the history
  • Loading branch information
claudep committed Aug 21, 2024
1 parent 60b4c0c commit 91efe8f
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 34 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <env>`, 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
Expand Down
6 changes: 0 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ exclude_lines = [
"if __name__ == .__main__.:",
]

[tool.pytest.ini_options]
python_files = ["test_*.py", "*tests.py"]
norecursedirs =[".*", "tmp*", "__pycache__"]
testpaths = ["tests"]
django_find_project = false

[tool.ruff]
exclude = [
".tox",
Expand Down
4 changes: 0 additions & 4 deletions tests/thumbnail_tests/test_alternative_resolutions.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import os

import pytest

from sorl.thumbnail import get_thumbnail
from sorl.thumbnail.conf import settings
from sorl.thumbnail.engines.pil_engine import Engine as PILEngine
from sorl.thumbnail.images import ImageFile

from .utils import BaseStorageTestCase

pytestmark = pytest.mark.django_db


class AlternativeResolutionsTest(BaseStorageTestCase):
name = 'retina.jpg'
Expand Down
3 changes: 0 additions & 3 deletions tests/thumbnail_tests/test_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import unittest
from io import StringIO

import pytest
from django.test import TestCase
from django.test.utils import override_settings
from PIL import Image
Expand All @@ -19,8 +18,6 @@
from .models import Item
from .utils import BaseTestCase, FakeFile, same_open_fd_count

pytestmark = pytest.mark.django_db


class BackendTest(BaseTestCase):
def test_delete(self):
Expand Down
3 changes: 0 additions & 3 deletions tests/thumbnail_tests/test_commands.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import os
from io import StringIO

import pytest
from django.core import management

from sorl.thumbnail.conf import settings

from .models import Item
from .utils import BaseTestCase

pytestmark = pytest.mark.django_db


class CommandTests(BaseTestCase):
def make_test_thumbnails(self, *sizes):
Expand Down
3 changes: 0 additions & 3 deletions tests/thumbnail_tests/test_engines.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import unittest
from subprocess import PIPE, Popen

import pytest
from django.core.files.storage import default_storage
from django.template.loader import render_to_string
from PIL import Image
Expand All @@ -20,8 +19,6 @@
from .models import Item
from .utils import BaseTestCase

pytestmark = pytest.mark.django_db


class SimpleTestCase(BaseTestCase):
def test_simple(self):
Expand Down
3 changes: 0 additions & 3 deletions tests/thumbnail_tests/test_filters.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
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):
Expand Down
4 changes: 0 additions & 4 deletions tests/thumbnail_tests/test_storage.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import unittest

import pytest

from sorl.thumbnail import default, get_thumbnail
from sorl.thumbnail.helpers import get_module_class

from .utils import BaseStorageTestCase

pytestmark = pytest.mark.django_db


class StorageTestCase(BaseStorageTestCase):
name = 'org.jpg'
Expand Down
3 changes: 0 additions & 3 deletions tests/thumbnail_tests/test_templatetags.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import re
from subprocess import PIPE, Popen

import pytest
from django.template.loader import render_to_string
from django.test import Client, TestCase
from django.test.utils import override_settings
Expand All @@ -14,8 +13,6 @@
from .models import Item
from .utils import DATA_DIR, BaseTestCase

pytestmark = pytest.mark.django_db


class TemplateTestCaseA(BaseTestCase):
def test_model(self):
Expand Down
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ envlist =

[testenv]
deps =
pytest
pytest-cov
pytest-django
coverage
pillow
redis: redis
dynamodb: boto
Expand All @@ -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
Expand Down

0 comments on commit 91efe8f

Please sign in to comment.