mirror of
https://github.com/jazzband/django-discover-jenkins.git
synced 2026-03-16 22:20:28 +00:00
commit
3f37a73437
9 changed files with 99 additions and 13 deletions
36
.travis.yml
Normal file
36
.travis.yml
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
sudo: no
|
||||
|
||||
language: python
|
||||
|
||||
env:
|
||||
- TOXENV=py27-1.7
|
||||
- TOXENV=py27-1.8
|
||||
- TOXENV=py27-1.9
|
||||
- TOXENV=py27-master
|
||||
- TOXENV=py32-1.7
|
||||
- TOXENV=py32-1.8
|
||||
- TOXENV=py33-1.7
|
||||
- TOXENV=py33-1.8
|
||||
- TOXENV=py34-1.7
|
||||
- TOXENV=py34-1.8
|
||||
- TOXENV=py34-1.9
|
||||
- TOXENV=py34-master
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- python: 3.5
|
||||
env: TOXENV=py35-1.8
|
||||
- python: 3.5
|
||||
env: TOXENV=py35-1.9
|
||||
- python: 3.5
|
||||
env: TOXENV=py35-master
|
||||
allow_failures:
|
||||
- env: TOXENV=py27-master
|
||||
- env: TOXENV=py34-master
|
||||
- env: TOXENV=py35-master
|
||||
|
||||
install:
|
||||
- pip install tox
|
||||
|
||||
script:
|
||||
- tox
|
||||
|
|
@ -4,9 +4,13 @@ from datetime import datetime
|
|||
from itertools import groupby
|
||||
from xml.sax.saxutils import XMLGenerator
|
||||
from xml.sax.xmlreader import AttributesImpl
|
||||
from django.utils.unittest import TextTestResult
|
||||
from discover_jenkins.utils import total_seconds
|
||||
|
||||
try:
|
||||
from unittest import TextTestResult
|
||||
except ImportError:
|
||||
from django.utils.unittest import TextTestResult
|
||||
|
||||
try:
|
||||
from django.utils.encoding import smart_text
|
||||
except ImportError:
|
||||
|
|
|
|||
|
|
@ -4,8 +4,16 @@ from optparse import make_option
|
|||
|
||||
import django
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.utils import unittest
|
||||
from django.utils.importlib import import_module
|
||||
|
||||
try:
|
||||
import unittest
|
||||
except ImportError:
|
||||
from django.utils import unittest
|
||||
|
||||
try:
|
||||
from importlib import import_module
|
||||
except ImportError:
|
||||
from django.utils.importlib import import_module
|
||||
|
||||
try:
|
||||
# Django 1.6
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ class Pep8Task(object):
|
|||
parser.add_argument("--pep8-ignore", dest="pep8-ignore",
|
||||
help="skip errors and warnings (e.g. E4,W)")
|
||||
parser.add_argument("--pep8-max-line-length",
|
||||
dest="pep8-max-line-length", type='int',
|
||||
dest="pep8-max-line-length", type=int,
|
||||
help="set maximum allowed line length (default: %d)" %
|
||||
pep8.MAX_LINE_LENGTH)
|
||||
parser.add_argument("--pep8-rcfile", dest="pep8-rcfile",
|
||||
|
|
|
|||
|
|
@ -3,9 +3,13 @@
|
|||
import os
|
||||
from optparse import make_option
|
||||
|
||||
from coverage.control import coverage
|
||||
import django
|
||||
|
||||
try:
|
||||
from coverage import coverage
|
||||
except ImportError:
|
||||
from coverage.control import coverage
|
||||
|
||||
from .. import settings
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
import os.path
|
||||
import subprocess
|
||||
|
||||
from django.utils.importlib import import_module
|
||||
try:
|
||||
from importlib import import_module
|
||||
except ImportError:
|
||||
from django.utils.importlib import import_module
|
||||
|
||||
from discover_jenkins.settings import PROJECT_APPS
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,5 @@
|
|||
from south.v2 import SchemaMigration
|
||||
from django.db import migrations
|
||||
|
||||
class Migration(SchemaMigration):
|
||||
def forwards(self, orm):
|
||||
a = 1 # pyflakes/pylint violation
|
||||
pass
|
||||
|
||||
def backwards(self, orm):
|
||||
pass
|
||||
class Migration(migrations.Migration):
|
||||
a = 1 # pyflakes/pylint violation
|
||||
|
|
@ -1,4 +1,7 @@
|
|||
from unittest import skipIf
|
||||
|
||||
from mock import MagicMock, patch
|
||||
import django
|
||||
from django.test import TestCase
|
||||
|
||||
from discover_jenkins import runner, tasks
|
||||
|
|
@ -37,6 +40,7 @@ class TestCIRunner(TestCase):
|
|||
tasks.run_jshint.JSHintTask,
|
||||
tasks.run_sloccount.SlocCountTask])
|
||||
|
||||
@skipIf(django.VERSION >= (1, 8), "optparse is not used on Django 1.8+")
|
||||
def test_get_task_options(self):
|
||||
"""
|
||||
For now, just do a simple test to make sure the right number of options
|
||||
|
|
|
|||
31
tox.ini
Normal file
31
tox.ini
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
[tox]
|
||||
args_are_paths = false
|
||||
envlist =
|
||||
py27-{1.7,1.8,1.9,master},
|
||||
py32-{1.7,1.8},
|
||||
py33-{1.7,1.8},
|
||||
py34-{1.7,1.8,1.9,master},
|
||||
py35-{1.8,1.9,master}
|
||||
|
||||
[testenv]
|
||||
basepython =
|
||||
py27: python2.7
|
||||
py32: python3.2
|
||||
py33: python3.3
|
||||
py34: python3.4
|
||||
py35: python3.5
|
||||
usedevelop = true
|
||||
setenv =
|
||||
PYTHONPATH=tests
|
||||
commands =
|
||||
{envbindir}/python -Wonce tests/manage.py test tests
|
||||
deps =
|
||||
py32: coverage>=3.4,<4.0
|
||||
{py27,py33,py34,py35}: coverage>=4.0
|
||||
flake8>=2.1.0
|
||||
mock>=1.0.1
|
||||
pylint>=0.23
|
||||
1.7: Django>=1.7,<1.8
|
||||
1.8: Django>=1.8,<1.9
|
||||
1.9: Django>=1.9,<1.10
|
||||
master: https://github.com/django/django/archive/master.tar.gz
|
||||
Loading…
Reference in a new issue