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

Barry Warsaw barry at moszumanska.debian.org
Wed Nov 16 20:48:56 UTC 2016


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

barry pushed a commit to branch master
in repository tox.

commit a9c5fead59e513c20658630f2032b2633d3299ce
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 febeecb..dd51a1f 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
@@ -497,7 +498,7 @@ class TestToxRun:
                 changedir=tests
                 commands= py.test --basetemp={envtmpdir} \
                                   --junitxml=junit-{envname}.xml
-                deps=pytest
+                sitepackages=True
             '''
         })
 
@@ -544,6 +545,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': """
         [testenv]
@@ -600,7 +602,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")
@@ -640,6 +642,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 f6d9d52..67533eb 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