[Python-modules-commits] [tox] 05/09: Skip some tests at build time, fix others.

Barry Warsaw barry at moszumanska.debian.org
Fri Dec 11 15:05:56 UTC 2015


This is an automated email from the git hooks/post-receive script.

barry pushed a commit to branch master
in repository tox.

commit 8c048660f221ad89273f170ad6561cd97365d251
Author: Barry Warsaw <barry at debian.org>
Date:   Sat Jun 21 18:44:45 2014 -0400

    Skip some tests at build time, fix others.
    
     Some of tox's unit tests require tox to be already built and installed.  This
     is a catch 22, and such tests can't pass at package build time.  These are
     disabled by adding a decorator that skips the test when an environment
     variable is set.  debian/rules sets this envar.  The DEP-8 tests do not set
     this envar and therefore run the full test suite.
    
     A few other tests just need some tweaks during package build, e.g. to use the
     system packages rather than trying to download them from PyPI.
    
     This also tweaks the tox.ini to use Debian's Python 3 py.test executable.
    
    Patch-Name: build-time-test-adjustments.patch
---
 tests/test_z_cmdline.py | 7 +++++--
 tox.ini                 | 3 ++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/tests/test_z_cmdline.py b/tests/test_z_cmdline.py
index a98d211..61e0227 100644
--- a/tests/test_z_cmdline.py
+++ b/tests/test_z_cmdline.py
@@ -1,3 +1,4 @@
+import os
 import tox
 import py
 import pytest
@@ -449,7 +450,7 @@ class TestToxRun:
                 changedir=tests
                 commands= py.test --basetemp={envtmpdir} \
                                   --junitxml=junit-{envname}.xml
-                deps=pytest
+                sitepackages=True
             '''
         })
 
@@ -496,6 +497,7 @@ class TestToxRun:
         ])
 
 
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
 def test_develop(initproj, cmd):
     initproj("example123", filedefs={'tox.ini': """
     """})
@@ -547,7 +549,7 @@ def test_test_usedevelop(cmd, initproj):
             changedir=tests
             commands=
                 py.test --basetemp={envtmpdir} --junitxml=junit-{envname}.xml []
-            deps=pytest
+            sitepackages=True
         '''
     })
     result = cmd.run("tox", "-v")
@@ -587,6 +589,7 @@ def test_test_usedevelop(cmd, initproj):
     ])
 
 
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
 def test_test_piphelp(initproj, cmd):
     initproj("example123", filedefs={'tox.ini': """
         # content of: tox.ini
diff --git a/tox.ini b/tox.ini
index 17efc83..67b578b 100644
--- a/tox.ini
+++ b/tox.ini
@@ -5,7 +5,8 @@ envlist=py27,py26,py34,py33,py35,pypy,flakes,py26-bare
 commands=echo {posargs}
 
 [testenv]
-commands= py.test --timeout=180 {posargs:tests}
+commands= py.test-3 --timeout=180 {posargs}
+whitelist_externals: py.test-3
 
 deps=pytest>=2.3.5
     pytest-timeout

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/tox.git



More information about the Python-modules-commits mailing list