Skip to content

Commit a02cfdd

Browse files
authored
Merge pull request #538 from leukeleu/pytest
Fixed #537 -- Switch to pytest
2 parents 5099d55 + 07f66b8 commit a02cfdd

23 files changed

+126
-124
lines changed

.coveragerc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[run]
2+
branch = true
3+
parallel = true
4+
5+
[report]
6+
show_missing = true
7+
skip_empty = true
8+
skip_covered = true
9+
precision = 2

.github/workflows/python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
max-parallel: 4
1515
matrix:
16-
python-version: ['3.6', '3.7', '3.8', '3.9']
16+
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
1717

1818
steps:
1919
- uses: actions/checkout@v2

CONTRIBUTING.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ contributions merged as quickly as possible:
1111
tests, first install tox, ``pip install tox``, then use ``tox``. This will let you know about any errors or style
1212
issues.
1313
4. While we're talking about tests, creating new ones for your code makes it
14-
much easier for us to merge your code quickly. ImageKit uses nose_, so
14+
much easier for us to merge your code quickly. ImageKit uses pytest_, so
1515
writing tests is painless. Check out `ours`__ for examples.
1616
5. It's a good idea to do your work in a branch; that way, you can work on more
1717
than one contribution at a time without making them interdependent.
@@ -20,5 +20,5 @@ contributions merged as quickly as possible:
2020
__ http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
2121
__ https://groups.google.com/forum/#!forum/django-imagekit
2222
__ irc://irc.freenode.net/imagekit
23-
.. _nose: https://nose.readthedocs.org/en/latest/
23+
.. _pytest: https://docs.pytest.org/en/latest/
2424
__ https://github.com/matthewwithanm/django-imagekit/tree/develop/tests

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
include AUTHORS
22
include LICENSE
33
include README.rst
4+
include pytest.ini
5+
include test-requirements.txt
46
include testrunner.py
57
include setup.cfg
68
include tests/*.py

pytest.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[pytest]
2+
django_find_project = false
3+
DJANGO_SETTINGS_MODULE = tests.settings

setup.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,6 @@ def exec_file(filepath, globalz=None, localz=None):
4444
packages=find_packages(exclude=['*.tests', '*.tests.*', 'tests.*', 'tests']),
4545
zip_safe=False,
4646
include_package_data=True,
47-
tests_require=[
48-
'beautifulsoup4>=4.4.0',
49-
'nose>=1.3.6',
50-
'django-nose>=1.4',
51-
'Pillow',
52-
'mock>=1.0.1',
53-
],
54-
test_suite='testrunner.run_tests',
5547
install_requires=[
5648
'django-appconf>=0.5',
5749
'pilkit>=0.2.0',

test-requirements.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Test requirements
2+
beautifulsoup4
3+
Pillow
4+
pytest
5+
pytest-cov
6+
pytest-django

testrunner.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

tests/conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import pytest
2+
3+
from .utils import clear_imagekit_test_files
4+
5+
6+
@pytest.fixture(scope='session', autouse=True)
7+
def imagekit_test_files_teardown(request):
8+
request.addfinalizer(clear_imagekit_test_files)

tests/imagegenerators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44

55
class TestSpec(ImageSpec):
6-
pass
6+
__test__ = False
77

88

99
class ResizeTo1PixelSquare(ImageSpec):

0 commit comments

Comments
 (0)