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

Barry Warsaw barry at moszumanska.debian.org
Fri Nov 20 21:45:19 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 6b7e6a70b3e0458548f8839ee58c3434919fc589
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 994d4ec..535e5a4 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
@@ -431,7 +432,7 @@ class TestToxRun:
                 changedir=tests
                 commands= py.test --basetemp={envtmpdir} \
                                   --junitxml=junit-{envname}.xml
-                deps=pytest
+                sitepackages=True
             '''
         })
 
@@ -478,6 +479,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': """
     """})
@@ -529,7 +531,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")
@@ -569,6 +571,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 d78bcbd..3658fff 100644
--- a/tox.ini
+++ b/tox.ini
@@ -5,7 +5,8 @@ envlist=py27,py26,py34,py33,pypy,flakes,py26-bare
 commands=echo {posargs}
 
 [testenv]
-commands= py.test --timeout=180 {posargs}
+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