[Pytest-commit] commit/tox: hpk42: Merged in msabramo/tox/tox_ini_add_flakes_target_3 (pull request #101)

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Mon Apr 28 09:54:46 CEST 2014


1 new commit in tox:

https://bitbucket.org/hpk42/tox/commits/9c19ff552a68/
Changeset:   9c19ff552a68
User:        hpk42
Date:        2014-04-28 09:54:33
Summary:     Merged in msabramo/tox/tox_ini_add_flakes_target_3 (pull request #101)

Add tox "flakes" target and fix "flakes" errors
Affected #:  12 files

diff -r 6f9368b8b63e8f1f150abc6ccdfaa113fcc05a2c -r 9c19ff552a68d173d0fa3146d4e1329d8b6b2012 tests/conftest.py
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -1,2 +1,2 @@
 
-from tox._pytestplugin import *
+from tox._pytestplugin import *  # noqa

diff -r 6f9368b8b63e8f1f150abc6ccdfaa113fcc05a2c -r 9c19ff552a68d173d0fa3146d4e1329d8b6b2012 tests/test_config.py
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -1,12 +1,11 @@
-import tox
-import pytest
-import os, sys
-import subprocess
+import sys
 from textwrap import dedent
 
 import py
+import pytest
+import tox
 import tox._config
-from tox._config import *
+from tox._config import *  # noqa
 from tox._config import _split_env
 
 
@@ -110,7 +109,6 @@
 
     def test_defaults_distshare(self, tmpdir, newconfig):
         config = newconfig([], "")
-        envconfig = config.envconfigs['python']
         assert config.distshare == config.homedir.join(".tox", "distshare")
 
     def test_defaults_changed_dir(self, tmpdir, newconfig):
@@ -168,6 +166,7 @@
             key2={xyz}
         """)
         reader = IniReader(config._cfg, fallbacksections=['mydefault'])
+        assert reader is not None
         py.test.raises(tox.exception.ConfigError,
             'reader.getdefault("mydefault", "key2")')
 

diff -r 6f9368b8b63e8f1f150abc6ccdfaa113fcc05a2c -r 9c19ff552a68d173d0fa3146d4e1329d8b6b2012 tests/test_interpreters.py
--- a/tests/test_interpreters.py
+++ b/tests/test_interpreters.py
@@ -2,7 +2,7 @@
 import os
 
 import pytest
-from tox.interpreters import *
+from tox.interpreters import *  # noqa
 
 @pytest.fixture
 def interpreters():

diff -r 6f9368b8b63e8f1f150abc6ccdfaa113fcc05a2c -r 9c19ff552a68d173d0fa3146d4e1329d8b6b2012 tests/test_venv.py
--- a/tests/test_venv.py
+++ b/tests/test_venv.py
@@ -3,7 +3,7 @@
 import pytest
 import os, sys
 import tox._config
-from tox._venv import *
+from tox._venv import *  # noqa
 
 #def test_global_virtualenv(capfd):
 #    v = VirtualEnv()
@@ -277,7 +277,7 @@
     venv = mocksession.getenv('python')
     venv.test()
     mocksession.report.expect("warning", "*test command found but not*")
-    assert venv.status == "commands failed"
+    assert venv.status == 0
 
 def test_install_command_whitelisted(newmocksession, monkeypatch):
     mocksession = newmocksession(['--recreate'], """
@@ -295,7 +295,7 @@
     assert venv.status == "commands failed"
 
 @pytest.mark.skipif("not sys.platform.startswith('linux')")
-def test_install_command_not_installed(newmocksession):
+def test_install_command_not_installed_bash(newmocksession):
     mocksession = newmocksession(['--recreate'], """
         [testenv]
         commands=
@@ -387,7 +387,7 @@
             [testenv]
             deps={distshare}/xyz-*
         """)
-        xyz = config.distshare.ensure("xyz-1.2.0.zip")
+        config.distshare.ensure("xyz-1.2.0.zip")
         xyz2 = config.distshare.ensure("xyz-1.2.1.zip")
         envconfig = config.envconfigs['python']
         venv = VirtualEnv(envconfig, session=mocksession)
@@ -507,7 +507,6 @@
     l = mocksession._pcalls
     assert len(l) == 2
     for x in l:
-        args = x.args
         env = x.env
         assert env is not None
         assert 'ENV_VAR' in env
@@ -585,6 +584,7 @@
     mocksession.report.not_expect("warning", "*test command found but not*")
     monkeypatch.setenv("PATH", str(tmpdir))
     x4 = venv.getcommandpath("x", cwd=tmpdir)
+    assert x4.endswith('/x')
     mocksession.report.expect("warning", "*test command found but not*")
 
 def test_sethome_only_on_option(newmocksession, monkeypatch):

diff -r 6f9368b8b63e8f1f150abc6ccdfaa113fcc05a2c -r 9c19ff552a68d173d0fa3146d4e1329d8b6b2012 tests/test_z_cmdline.py
--- a/tests/test_z_cmdline.py
+++ b/tests/test_z_cmdline.py
@@ -1,7 +1,6 @@
 import tox
 import py
 import pytest
-import sys
 from tox._pytestplugin import ReportExpectMock
 try:
     import json
@@ -129,7 +128,6 @@
         })
         config = parseconfig([])
         session = Session(config)
-        envlist = ['hello', 'world']
         envs = session.venvlist
         assert len(envs) == 2
         env1, env2 = envs
@@ -582,6 +580,7 @@
     l = distshare.listdir()
     assert len(l) == 1
     sdistfile = l[0]
+    assert 'pkg123-0.7.zip' in str(sdistfile)
 
 def test_separate_sdist(cmd, initproj):
     distshare = cmd.tmpdir.join("distshare")
@@ -611,7 +610,6 @@
             distshare=%s
             sdistsrc={distshare}/pkg123-*
     """ % distshare)
-    p0 = distshare.ensure("pkg123-1.3.5.zip")
     p = distshare.ensure("pkg123-1.4.5.zip")
     distshare.ensure("pkg123-1.4.5a1.zip")
     session = Session(config)

diff -r 6f9368b8b63e8f1f150abc6ccdfaa113fcc05a2c -r 9c19ff552a68d173d0fa3146d4e1329d8b6b2012 tox.ini
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
 [tox]
-envlist=py27,py26,py34,py33,py32,pypy
+envlist=py27,py26,py34,py33,py32,pypy,flakes
 
 [testenv:X]
 commands=echo {posargs}
@@ -18,6 +18,10 @@
         --junitxml={envlogdir}/junit-{envname}.xml \
         check_sphinx.py {posargs}
 
+[testenv:flakes]
+deps = pytest-flakes>=0.2
+commands = py.test --flakes -m flakes tox tests
+
 [testenv:py25]
 setenv= PIP_INSECURE=1
 

diff -r 6f9368b8b63e8f1f150abc6ccdfaa113fcc05a2c -r 9c19ff552a68d173d0fa3146d4e1329d8b6b2012 tox/__init__.py
--- a/tox/__init__.py
+++ b/tox/__init__.py
@@ -20,4 +20,4 @@
     class MissingDependency(Error):
         """ a dependency could not be found or determined. """
 
-from tox._cmdline import main as cmdline
+from tox._cmdline import main as cmdline  # noqa

diff -r 6f9368b8b63e8f1f150abc6ccdfaa113fcc05a2c -r 9c19ff552a68d173d0fa3146d4e1329d8b6b2012 tox/_cmdline.py
--- a/tox/_cmdline.py
+++ b/tox/_cmdline.py
@@ -79,7 +79,6 @@
         return f
 
     def popen(self, args, cwd=None, env=None, redirect=True, returnout=False):
-        logged_command = "%s$ %s" %(cwd, " ".join(map(str, args)))
         f = outpath = None
         resultjson = self.session.config.option.resultjson
         if resultjson or redirect:
@@ -411,7 +410,8 @@
                 sdist_path = self._makesdist()
             except tox.exception.InvocationError:
                 v = sys.exc_info()[1]
-                self.report.error("FAIL could not package project")
+                self.report.error("FAIL could not package project - v = %r" %
+                    v)
                 return
             sdistfile = self.config.distshare.join(sdist_path.basename)
             if sdistfile != sdist_path:

diff -r 6f9368b8b63e8f1f150abc6ccdfaa113fcc05a2c -r 9c19ff552a68d173d0fa3146d4e1329d8b6b2012 tox/_config.py
--- a/tox/_config.py
+++ b/tox/_config.py
@@ -1,13 +1,10 @@
 import argparse
-import distutils.sysconfig
 import os
 import random
 import sys
 import re
 import shlex
 import string
-import subprocess
-import textwrap
 import pkg_resources
 
 from tox.interpreters import Interpreters
@@ -205,7 +202,7 @@
 class parseini:
     def __init__(self, config, inipath):
         config.toxinipath = inipath
-        config.toxinidir = toxinidir = config.toxinipath.dirpath()
+        config.toxinidir = config.toxinipath.dirpath()
 
         self._cfg = py.iniconfig.IniConfig(config.toxinipath)
         config._cfg = self._cfg
@@ -239,7 +236,7 @@
         # determine indexserver dictionary
         config.indexserver = {'default': IndexServerConfig('default')}
         prefix = "indexserver"
-        for line in reader.getlist(toxsection, "indexserver"):
+        for line in reader.getlist(toxsection, prefix):
             name, url = map(lambda x: x.strip(), line.split("=", 1))
             config.indexserver[name] = IndexServerConfig(name, url)
 

diff -r 6f9368b8b63e8f1f150abc6ccdfaa113fcc05a2c -r 9c19ff552a68d173d0fa3146d4e1329d8b6b2012 tox/_venv.py
--- a/tox/_venv.py
+++ b/tox/_venv.py
@@ -1,6 +1,5 @@
 from __future__ import with_statement
-import sys, os, re
-import subprocess
+import sys, os
 import py
 import tox
 from tox._config import DepConfig
@@ -121,8 +120,6 @@
         """
         if action is None:
             action = self.session.newaction(self, "update")
-        report = self.session.report
-        name = self.envconfig.envname
         rconfig = CreationConfig.readconfig(self.path_config)
         if not self.envconfig.recreate and rconfig and \
             rconfig.matches(self._getliveconfig()):
@@ -142,7 +139,8 @@
             self.install_deps(action)
         except tox.exception.InvocationError:
             v = sys.exc_info()[1]
-            return "could not install deps %s" %(self.envconfig.deps,)
+            return "could not install deps %s; v = %r" % (
+                self.envconfig.deps, v)
 
     def _getliveconfig(self):
         python = self.envconfig._basepython_info.executable

diff -r 6f9368b8b63e8f1f150abc6ccdfaa113fcc05a2c -r 9c19ff552a68d173d0fa3146d4e1329d8b6b2012 tox/_verlib.py
--- a/tox/_verlib.py
+++ b/tox/_verlib.py
@@ -8,7 +8,6 @@
 
 """
 
-import sys
 import re
 
 class IrrationalVersionError(Exception):

diff -r 6f9368b8b63e8f1f150abc6ccdfaa113fcc05a2c -r 9c19ff552a68d173d0fa3146d4e1329d8b6b2012 tox/interpreters.py
--- a/tox/interpreters.py
+++ b/tox/interpreters.py
@@ -1,8 +1,6 @@
 import sys
-import os
 import py
 import re
-import subprocess
 import inspect
 
 class Interpreters:

Repository URL: https://bitbucket.org/hpk42/tox/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.


More information about the pytest-commit mailing list