Skip to content
This repository has been archived by the owner on Mar 30, 2020. It is now read-only.

Commit

Permalink
more tox tests
Browse files Browse the repository at this point in the history
  • Loading branch information
orsinium committed Jan 3, 2018
1 parent fdeacb4 commit 56780d5
Show file tree
Hide file tree
Showing 9 changed files with 101 additions and 31 deletions.
4 changes: 3 additions & 1 deletion requirements-optional.txt → constraints.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
bson
djangorestframework
django>=1.7
djangorestframework>=3.5
marshmallow
pyschemes
PyYAML
tablib

2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

9 changes: 9 additions & 0 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
bson
django>=1.7
djangorestframework>=3.5
marshmallow
pyschemes
PyYAML
six
tablib

2 changes: 2 additions & 0 deletions requirements/main.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
six

2 changes: 2 additions & 0 deletions requirements-testing.txt → requirements/testing-side.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ bson
marshmallow
pyschemes
PyYAML
six
tablib

29 changes: 19 additions & 10 deletions run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,37 @@

import os
import sys
import django

import unittest
# for python2
if not hasattr(unittest.TestCase, 'subTest'):
import unittest2 as unittest


sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/example')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
django.setup()
testing_type = sys.argv[1] if len(sys.argv) > 1 else ''


if not testing_type or testing_type in ('django', 'djside'):
import django
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/example')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
django.setup()


import djburger # noQA


from tests.django import * # noQA
from tests.django_and_other import * # noQA
from tests.main import * # noQA
from tests.marshmallow import * # noQA
from tests.pyschemes import * # noQA
from tests.rest import * # noQA
from tests import main
if not testing_type or testing_type == 'django':
from tests import django
if not testing_type or testing_type == 'djside':
from tests import djside
if not testing_type or testing_type == 'rest':
from tests import rest
if not testing_type or testing_type == 'marshmallow':
from tests import marshmallow
if not testing_type or testing_type == 'pyschemes':
from tests import pyschemes


if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
keywords = 'djburger framework django contracts pre post validation',

packages = ['djburger'],
requires = [],
requires = ['six'],

url = 'https://github.com/orsinium/djburger',
download_url = 'https://github.com/orsinium/djburger/tarball/master',
Expand Down
File renamed without changes.
82 changes: 65 additions & 17 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,30 +1,78 @@
[tox]
envlist =
py27-unittest2-django18-rest35,
py27-unittest2-django110-rest,
py27-unittest2-django111-rest,
py35-django18-rest35,
py35-django110-rest,
py35-django111-rest,
py35-django20-rest,

[testenv]
commands = python run_tests.py
# main
py{2,3}-main,
# django
py2-django-django{18,110,111},
py3-django-django{18,110,111,20,master},
# djside
py2-djside-django{18,110,111},
py3-djside-django{18,110,111,20,master},
# side
py2-side-django{18,110,111},
py3-side-django{18,110,111,20,master},
# other
flake8,


[testenv:main]
commands = python run_tests.py main
envdir = {toxworkdir}/venvs/{envname}
setenv =
PYTHONDONTWRITEBYTECODE=1
PYTHONWARNINGS=once
deps =
py2: unittest2
-rrequirements/main.txt


[testenv:django]
commands = python run_tests.py django
envdir = {toxworkdir}/venvs/{envname}
setenv =
PYTHONDONTWRITEBYTECODE=1
PYTHONWARNINGS=once
deps =
# django
django18: Django>=1.8,<1.9
django110: Django>=1.10,<1.11
django111: Django>=1.11,<2.0
django111: Django>=1.11,<1.12
django20: Django>=2.0,<2.1
djangomaster: https://github.com/django/django/archive/master.tar.gz
rest: djangorestframework
rest35: djangorestframework>=3.5,<3.6
rest32: djangorestframework>=3.2,<3.3
unittest2: unittest2
-rrequirements-testing.txt
# testing
py2: unittest2
-rrequirements/main.txt


[testenv:djside]
commands = python run_tests.py djside
envdir = {toxworkdir}/venvs/{envname}
setenv =
PYTHONDONTWRITEBYTECODE=1
PYTHONWARNINGS=once
deps =
django{110,111,20,master}: djangorestframework
django18: djangorestframework>=3.5,<3.6
py2: unittest2
-rrequirements/testing-side.txt


[flake8]
[testenv:side]
commands = python run_tests.py marshmallow pyschemes
envdir = {toxworkdir}/venvs/{envname}
setenv =
PYTHONDONTWRITEBYTECODE=1
PYTHONWARNINGS=once
deps =
py2: unittest2
-rrequirements/testing-side.txt


[testenv:flake8]
max-line-length=120
skip_install = True
deps =
flake8
commands =
flake8 --exclude=migrations {toxinidir}/djburger

0 comments on commit 56780d5

Please sign in to comment.