-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start transition from nose to pytest
- Loading branch information
1 parent
936a086
commit d660358
Showing
6 changed files
with
64 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,22 @@ | ||
sudo: false | ||
language: python | ||
install: pip install -r requirements.txt | ||
script: nosetests -v | ||
install: pip install tox | ||
script: tox | ||
matrix: | ||
include: | ||
- python: 2.7 | ||
env: TOXENV=py27 | ||
- python: 3.4 | ||
env: TOXENV=py34 | ||
- python: 3.5 | ||
env: TOXENV=py35 | ||
- python: 3.6 | ||
env: TOXENV=py36 | ||
- python: 3.7 | ||
dist: xenial | ||
env: TOXENV=py37 | ||
- python: pypy | ||
env: TOXENV=pypy | ||
- python: 3.7 | ||
dist: xenial | ||
env: TOXENV=lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
include README.rst LICENSE requirements.txt | ||
include README.rst LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
coverage | ||
django<2 | ||
doc8 | ||
gj | ||
mock | ||
nose | ||
django<2 | ||
pylint | ||
pytest | ||
pytest-cov | ||
pytest-django | ||
sphinx | ||
tox | ||
twine | ||
wheel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
import io | ||
from setuptools import setup, find_packages | ||
from setuptools import setup | ||
from setuptools.command.test import test as TestCommand | ||
import sys | ||
|
||
import diskcache | ||
|
||
|
||
class Tox(TestCommand): | ||
def finalize_options(self): | ||
TestCommand.finalize_options(self) | ||
|
@@ -13,24 +12,24 @@ def finalize_options(self): | |
def run_tests(self): | ||
import tox | ||
errno = tox.cmdline(self.test_args) | ||
sys.exit(errno) | ||
exit(errno) | ||
|
||
|
||
with io.open('README.rst', encoding='UTF-8') as reader: | ||
with open('README.rst') as reader: | ||
readme = reader.read() | ||
|
||
setup( | ||
name='diskcache', | ||
name=diskcache.__title__, | ||
version=diskcache.__version__, | ||
description='Disk and file backed cache.', | ||
description='Disk Cache -- Disk and file backed persistent cache.', | ||
long_description=readme, | ||
author='Grant Jenks', | ||
author_email='[email protected]', | ||
url='http://www.grantjenks.com/docs/diskcache/', | ||
packages=find_packages(exclude=('tests', 'docs')), | ||
package_data={'': ['LICENSE', 'README.rst']}, | ||
license='Apache 2.0', | ||
packages=['diskcache'], | ||
tests_require=['tox'], | ||
cmdclass={'test': Tox}, | ||
license='Apache 2.0', | ||
install_requires=[], | ||
classifiers=( | ||
'Development Status :: 5 - Production/Stable', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,29 @@ | ||
[tox] | ||
envlist=py27,py34,py35,py36 | ||
envlist=py27,py34,py35,py36,py37,pypy,lint | ||
skip_missing_interpreters=True | ||
|
||
[testenv] | ||
deps=nose | ||
mock | ||
django>=1.11,<1.12 | ||
commands=nosetests | ||
deps= | ||
django<2 | ||
mock | ||
pytest | ||
pytest-django | ||
commands=python -m pytest | ||
setenv = | ||
DJANGO_SETTINGS_MODULE=tests.settings | ||
PYTHONPATH={toxinidir}:{toxinidir}/tests | ||
|
||
[pytest] | ||
addopts= | ||
--doctest-modules | ||
--doctest-glob "*.rst" | ||
--ignore tests/benchmark_core.py | ||
--ignore tests/benchmark_djangocache.py | ||
--ignore tests/benchmark_glob.py | ||
--ignore tests/plot.py | ||
norecursedirs=site-packages | ||
testpaths=docs diskcache tests | ||
|
||
[testenv:lint] | ||
deps=pylint | ||
commands=pylint diskcache |