Skip to content

Commit ba48402

Browse files
mbaechtoldauvipy
authored andcommitted
Fix the test environment (#118)
* Add missing doc strings. This fixes the errors in the "pydocstyle" test environment. * Run coverage against Python 3. This is required because Django > 2.0 is installed by default (support for Python 2 has been dropped in Django 2.0). * Install "sphinx_celery" from the master branch. We need the fix from celery/sphinx_celery@28d8f42 which has not been released yet. * Run "apicheck" test environment against Python 3. The "apicheck" test environment installs the latest release of "Django" through "requirements/docs.txt", which no longer supports Python 2. * Enable the "linkcheck" test environment. The "linkcheck" test environment installs the latest release of "Django" through "requirements/docs.txt", which no longer supports Python 2. So it needs to be run with Python 3. * Install "ephem" in the test suite. This fixes the tests failing due to the missing "ephem" library, which has been removed in #94. * Make "pypy" test environment work on Travis.
1 parent 9001f0f commit ba48402

File tree

4 files changed

+46
-52
lines changed

4 files changed

+46
-52
lines changed

Diff for: .travis.yml

+19-24
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,26 @@ language: python
22
sudo: false
33
cache: false
44
python:
5-
- '3.5'
6-
os:
7-
- linux
5+
- 2.7
6+
- 3.4
7+
- 3.5
8+
- pypy
89
env:
9-
global:
10-
PYTHONUNBUFFERED=yes
11-
matrix:
12-
- TOXENV=2.7-django1.10
13-
- TOXENV=2.7-django1.9
14-
- TOXENV=2.7-django1.8
15-
- TOXENV=pypy-django1.10
16-
- TOXENV=pypy-django1.9
17-
- TOXENV=pypy-django1.8
18-
- TOXENV=3.4-django1.10
19-
- TOXENV=3.4-django1.9
20-
- TOXENV=3.4-django1.8
21-
- TOXENV=3.5-django1.10
22-
- TOXENV=3.5-django1.9
23-
- TOXENV=3.5-django1.8
24-
- TOXENV=flake8
25-
- TOXENV=flakeplus
26-
- TOXENV=apicheck
27-
- TOXENV=pydocstyle
28-
- TOXENV=cov
29-
install: travis_retry pip install -U tox
10+
- DJANGO=1.8
11+
- DJANGO=1.9
12+
- DJANGO=1.10
13+
- DJANGO=1.11
14+
os:
15+
- linux
16+
matrix:
17+
include:
18+
- { python: 2.7, env: TOXENV=flake8 }
19+
- { python: 2.7, env: TOXENV=flakeplus }
20+
- { python: 2.7, env: TOXENV=pydocstyle }
21+
- { python: 3.5, env: TOXENV=apicheck }
22+
- { python: 3.5, env: TOXENV=linkcheck }
23+
- { python: 3.5, env: TOXENV=cov }
24+
install: travis_retry pip install -U tox-travis
3025
services: rabbitmq
3126
script: tox -v -- -v
3227
after_success:

Diff for: django_celery_beat/schedulers.py

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class ModelEntry(ScheduleEntry):
5353
save_fields = ['last_run_at', 'total_run_count', 'no_changes']
5454

5555
def __init__(self, model, app=None):
56+
"""Initialize the model entry."""
5657
self.app = app or current_app._get_current_object()
5758
self.name = model.name
5859
self.task = model.task
@@ -177,6 +178,7 @@ class DatabaseScheduler(Scheduler):
177178
_initial_read = False
178179

179180
def __init__(self, *args, **kwargs):
181+
"""Initialize the database scheduler."""
180182
self._dirty = set()
181183
Scheduler.__init__(self, *args, **kwargs)
182184
self._finalize = Finalize(self, self.sync, exitpriority=5)

Diff for: requirements/docs.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
sphinx_celery>=1.1
1+
https://github.com/celery/sphinx_celery/archive/master.zip
22
Django>=1.10

Diff for: tox.ini

+24-27
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,24 @@
11
[tox]
22
envlist =
3-
2.7-django1.11
4-
2.7-django1.10
5-
2.7-django1.9
6-
2.7-django1.8
7-
pypy-django1.11
8-
pypy-django1.10
9-
pypy-django1.9
10-
pypy-django1.8
11-
3.4-django1.11
12-
3.4-django1.10
13-
3.4-django1.9
14-
3.4-django1.8
15-
3.5-django1.11
16-
3.5-django1.10
17-
3.5-django1.9
18-
3.5-django1.8
3+
py27-django{18,19,110,111}
4+
py34-django{18,19,110,111}
5+
py35-django{18,19,110,111}
6+
pypy-django{18,19,110,111}
197

208
flake8
219
flakeplus
2210
apicheck
11+
linkcheck
2312
pydocstyle
2413
cov
2514

15+
[travis:env]
16+
DJANGO =
17+
1.8: django18
18+
1.9: django19
19+
1.10: django110
20+
1.11: django111
21+
2622
[testenv]
2723
deps=
2824
-r{toxinidir}/requirements/default.txt
@@ -31,10 +27,12 @@ deps=
3127

3228
cov: -r{toxinidir}/requirements/test-django.txt
3329

34-
django1.11: -r{toxinidir}/requirements/test-django111.txt
35-
django1.10: -r{toxinidir}/requirements/test-django110.txt
36-
django1.9: -r{toxinidir}/requirements/test-django19.txt
37-
django1.8: -r{toxinidir}/requirements/test-django18.txt
30+
django111: -r{toxinidir}/requirements/test-django111.txt
31+
django110: -r{toxinidir}/requirements/test-django110.txt
32+
django19: -r{toxinidir}/requirements/test-django19.txt
33+
django18: -r{toxinidir}/requirements/test-django18.txt
34+
35+
py{27,34,35,py},cov: ephem
3836

3937
linkcheck,apicheck: -r{toxinidir}/requirements/docs.txt
4038
flake8,flakeplus,pydocstyle: -r{toxinidir}/requirements/pkgutils.txt
@@ -45,34 +43,33 @@ commands =
4543
pip install -U https://github.com/celery/kombu/zipball/master#egg=kombu
4644
py.test -xv
4745

48-
basepython =
49-
2.7,flake8,flakeplus,apicheck,linkcheck,pydocstyle,cov: python2.7
50-
3.4: python3.4
51-
3.5: python3.5
52-
pypy: pypy
53-
pypy3: pypy3
54-
5546
[testenv:apicheck]
47+
basepython = python3.5
5648
commands =
5749
sphinx-build -W -b apicheck -d {envtmpdir}/doctrees docs docs/_build/apicheck
5850

5951
[testenv:linkcheck]
52+
basepython = python3.5
6053
commands =
6154
sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees docs docs/_build/linkcheck
6255

6356
[testenv:flake8]
57+
basepython = python2.7
6458
commands =
6559
flake8 {toxinidir}/django_celery_beat {toxinidir}/t
6660

6761
[testenv:flakeplus]
62+
basepython = python2.7
6863
commands =
6964
flakeplus --2.7 {toxinidir}/django_celery_beat {toxinidir}/t
7065

7166
[testenv:pydocstyle]
67+
basepython = python2.7
7268
commands =
7369
pydocstyle {toxinidir}/django_celery_beat
7470

7571
[testenv:cov]
72+
basepython = python3.5
7673
usedevelop = true
7774
commands =
7875
pip install -U https://github.com/celery/celery/zipball/master#egg=celery

0 commit comments

Comments
 (0)