Added support for tox testing

This commit is contained in:
2020-01-14 14:40:04 +01:00
parent 8ab2f818e4
commit 9534c4a038
5 changed files with 49 additions and 12 deletions

18
.gitignore vendored
View File

@@ -1,11 +1,13 @@
/.idea/
/backup/
/env/
/tmp/
*.pyc
*.mo
.coverage
geckodriver.log
/.coverage
/.tox/
/geckodriver.log
.idea/
django_dav_events.egg-info/
backup/
env/
tmp/
/django_dav_events.egg-info/

27
.pylintrc Normal file
View File

@@ -0,0 +1,27 @@
[MASTER]
persistent=no
load-plugins=pylint_django
[MESSAGES CONTROL]
disable=missing-docstring,
missing-module-docstring,
missing-class-docstring,
missing-function-docstring,
useless-object-inheritance,
[BASIC]
good-names=_,
c,
d,
e,
i,
j,
k,
[FORMAT]
max-line-length=120

View File

@@ -1,12 +1,13 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from tempfile import mkdtemp as _mkdtmp
from tempfile import mkdtemp as _mkdtemp
def mkdtemp(prefix):
dirname = os.path.dirname
pkg_base_dir = dirname(dirname(dirname(__file__)))
tmp_dir = os.path.join(pkg_base_dir, 'tmp')
os.makedirs(tmp_dir, exist_ok=True)
return _mkdtmp(prefix=prefix, dir=tmp_dir)
if not os.path.exists(tmp_dir):
os.makedirs(tmp_dir)
return _mkdtemp(prefix=prefix, dir=tmp_dir)

View File

@@ -118,7 +118,7 @@ setup(
'babel',
'django >= 1.11, < 2.0',
'django-extensions',
'django-bootstrap3',
'django-bootstrap3 < 12',
'django-countries',
'django-datetime-widget',
'pytz',

7
tox.ini Normal file
View File

@@ -0,0 +1,7 @@
[tox]
envlist = py3,py2
[testenv]
commands = python --version
python -m coverage run setup.py test
coverage report --skip-covered