Forráskód Böngészése

Use py.test as the test runner

Signed-off-by: Daniel Nephin <[email protected]>
Daniel Nephin 10 éve
szülő
commit
c1ed1efde8
3 módosított fájl, 20 hozzáadás és 20 törlés
  1. 3 4
      requirements-dev.txt
  2. 1 4
      setup.py
  3. 16 12
      tox.ini

+ 3 - 4
requirements-dev.txt

@@ -1,5 +1,4 @@
 coverage==3.7.1
-flake8==2.3.0
-mock >= 1.0.1
-nose==1.3.4
-pep8==1.6.1
+mock>=1.0.1
+pytest==2.7.2
+pytest-cov==2.1.0

+ 1 - 4
setup.py

@@ -41,13 +41,10 @@ install_requires = [
 
 
 tests_require = [
-    'nose',
-    'flake8',
+    'pytest',
 ]
 
 
-if sys.version_info < (2, 7):
-    tests_require.append('unittest2')
 if sys.version_info[:1] < (3,):
     tests_require.append('mock >= 1.0.1')
 

+ 16 - 12
tox.ini

@@ -8,10 +8,14 @@ passenv =
 setenv =
     HOME=/tmp
 deps =
-    -rrequirements.txt
+    -rrequirements-dev.txt
 commands =
-    nosetests -v --with-coverage --cover-branches --cover-package=compose --cover-erase --cover-html-dir=coverage-html --cover-html {posargs}
-    flake8 compose tests setup.py
+    py.test -v \
+        --cov=compose \
+        --cov-report html \
+        --cov-report term \
+        --cov-config=tox.ini \
+        {posargs}
 
 [testenv:pre-commit]
 skip_install = True
@@ -21,16 +25,16 @@ commands =
     pre-commit install
     pre-commit run --all-files
 
-[testenv:py27]
-deps =
-    {[testenv]deps}
-    -rrequirements-dev.txt
+# Coverage configuration
+[run]
+branch = True
 
-[testenv:py34]
-deps =
-    {[testenv]deps}
-    flake8
-    nose
+[report]
+show_missing = true
+
+[html]
+directory = coverage-html
+# end coverage configuration
 
 [flake8]
 # Allow really long lines for now