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

Run tests with standard django-admin #755

Merged
merged 1 commit into from
Aug 29, 2024
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: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,3 @@ jobs:
uses: codecov/codecov-action@v3
with:
name: Python ${{ matrix.python-version }}

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[toml]
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
Loading