Skip to content

Commit d1e6799

Browse files
committed
moved to pytest
lower the number of cpus used by xdist fixed typo foo
1 parent 797cae2 commit d1e6799

File tree

5 files changed

+14
-13
lines changed

5 files changed

+14
-13
lines changed

requirements/optional.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
-r base.txt
2-
djangorestframework>=2.3
2+
djangorestframework>=3.3

requirements/project.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
-r optional.txt
2-
Django>=1.4
2+
Django>=1.7

requirements/testing.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
-r optional.txt
22
mock==1.0.1
3+
pytest==2.8.3
4+
pytest-django==2.9.1
5+
pytest-xdist==1.13.1
6+
pytest-cov==2.2.0

runtests.py

100644100755
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
#!/usr/bin/env python
2-
import os
3-
import sys
2+
import pytest
43

5-
if __name__ == "__main__":
6-
app_to_test = "oauth2_provider"
7-
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "oauth2_provider.tests.settings")
8-
9-
from django.core.management import execute_from_command_line
10-
execute_from_command_line([sys.argv[0], "test", app_to_test])
4+
pytest.main()

tox.ini

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[pytest]
2+
DJANGO_SETTINGS_MODULE=oauth2_provider.tests.settings
3+
testpaths=oauth2_provider
4+
15
[tox]
26
envlist =
37
{py27}-django{17,18,19},
@@ -9,13 +13,12 @@ envlist =
913
flake8
1014

1115
[testenv]
12-
commands=coverage run -a runtests.py
16+
commands=python runtests.py -q --cov oauth2_provider --cov-report= --cov-append
1317
deps =
1418
django17: Django==1.7.10
1519
django18: Django==1.8.6
1620
django19: https://www.djangoproject.com/download/1.9rc1/tarball/
17-
py32: coverage<4
18-
py{27,33,34,35}: coverage
21+
coverage<4
1922
-rrequirements/testing.txt
2023

2124
[testenv:docs]

0 commit comments

Comments
 (0)