From issues-reply at bitbucket.org Tue Apr 5 09:06:38 2016 From: issues-reply at bitbucket.org (=?utf-8?q?Andr=C3=A9_Caron?=) Date: Tue, 05 Apr 2016 13:06:38 -0000 Subject: [Pytest-commit] Issue #322: USERPROFILE is not passed by default on Windows (hpk42/tox) Message-ID: <20160405130638.1262.60256@celery-worker-101.ash1.bb-inf.net> New issue 322: USERPROFILE is not passed by default on Windows https://bitbucket.org/hpk42/tox/issues/322/userprofile-is-not-passed-by-default-on Andr? Caron: I just got bit by this strange issue. One of my Tox virtual environment creates a nested virtual environment which does not respect settings in `~/pip/pip.ini`. This is problematic because the nested environment needs to install packages from our corporate DevPI installation. I can "fix" this by adding `USERPROFILE` in `passenv`, but I find it strange that the default behavior breaks pip and it's really hard to diagnose this unless you can make educated guesses about pip internals. -------------- next part -------------- An HTML attachment was scrubbed... URL: From issues-reply at bitbucket.org Mon Apr 11 04:45:39 2016 From: issues-reply at bitbucket.org (Andriy Yurchuk) Date: Mon, 11 Apr 2016 08:45:39 -0000 Subject: [Pytest-commit] Issue #323: Support for Python 3.2 broken (hpk42/tox) Message-ID: <20160411084539.49199.20545@celery-worker-102.ash1.bb-inf.net> New issue 323: Support for Python 3.2 broken https://bitbucket.org/hpk42/tox/issues/323/support-for-python-32-broken Andriy Yurchuk: I just came across a problem with tox and Python 3.2 that is described here: https://github.com/travis-ci/travis-ci/issues/5485 I am running tox by the ShiningPanda Jenkins plugin which installs tox like this: ``` #! [py32] $ /var/lib/jenkins/shiningpanda/jobs/f517a249/tools/bin/python -c "import pip; pip.main();" install --upgrade tox Collecting tox Using cached tox-2.3.1-py2.py3-none-any.whl Collecting virtualenv>=1.11.2 (from tox) Using cached virtualenv-15.0.1-py2.py3-none-any.whl Collecting py>=1.4.17 (from tox) Using cached py-1.4.31-py2.py3-none-any.whl Collecting pluggy<0.4.0,>=0.3.0 (from tox) Using cached pluggy-0.3.1-py2.py3-none-any.whl ``` This installs virtualenv version 15.0.1 which comes from the tox's [setup.py](https://bitbucket.org/hpk42/tox/src/4dbfb1f1eb86b35cbd2c83461e1e294651e89cf6/setup.py?fileviewer=file-view-default#setup.py-39) Looks like changing that to `virtualenv<14.0.0` would fix the problem. -------------- next part -------------- An HTML attachment was scrubbed... URL: From issues-reply at bitbucket.org Wed Apr 13 10:56:18 2016 From: issues-reply at bitbucket.org (Brandon Maister) Date: Wed, 13 Apr 2016 14:56:18 -0000 Subject: [Pytest-commit] Issue #324: -v output does not include diff that non-verbose output does for long dicts (hpk42/tox) Message-ID: <20160413145618.7127.69046@celery-worker-101.ash1.bb-inf.net> New issue 324: -v output does not include diff that non-verbose output does for long dicts https://bitbucket.org/hpk42/tox/issues/324/v-output-does-not-include-diff-that-non Brandon Maister: given `ex.py`: ``` #!python def test_long_assertion(): long = 'a' * 50 a = {i: long for i in range(8)} b = dict(**a) b[7] = 'short' assert a == b ``` invoking py.test gives a very helpful error message: ``` $ py.test ex.py ========= test session starts ========= platform darwin -- Python 2.7.5, pytest-2.9.1, py-1.4.31, pluggy-0.3.1 rootdir: /private/tmp, inifile: plugins: cov-2.2.1 collected 1 items ex.py F =================== FAILURES =================== ____________________ test_long_assertion ____________________ def test_long_assertion(): long = 'a' * 50 a = {i: long for i in range(8)} b = dict(**a) b[7] = 'short' > assert a == b E assert {0: 'aaaaaaaa...aaaaaaa', ...} == {0: 'aaaaaaaaa...aaaaaaa', ...} E Omitting 7 identical items, use -v to show E Differing items: E {7: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'} != {7: 'short'} E Use -v to get the full diff ex.py:6: AssertionError ``` However, running with `-v` breaks the diff: ``` $ py.test -v ex.py ================================== test session starts =================================== platform darwin -- Python 2.7.5, pytest-2.9.1, py-1.4.31, pluggy-0.3.1 -- /Users/bwm/findable/virtualenvs/consumer/bin/python cachedir: .cache rootdir: /private/tmp, inifile: plugins: cov-2.2.1 collected 1 items ex.py::test_long_assertion FAILED ======================================== FAILURES ======================================== __________________________________ test_long_assertion ___________________________________ def test_long_assertion(): long = 'a' * 50 a = {i: long for i in range(8)} b = dict(**a) b[7] = 'short' > assert a == b E assert {0: 'aaaaaaaa...aaaaaaa', ...} == {0: 'aaaaaaaaa...aaaaaaa', ...} E Common items: E {0: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', E 1: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', E 2: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', E 3: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', E 4: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', E 5: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', E 6: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'} E Differing items: E Detailed information truncated (11 more lines), use "-vv" to show ex.py:6: AssertionError ================================ 1 failed in 0.01 seconds ================================ ``` `-vv` does include everything, but it's very verbose when I have dozens of items in my dicts. -------------- next part -------------- An HTML attachment was scrubbed... URL: From issues-reply at bitbucket.org Wed Apr 13 13:51:39 2016 From: issues-reply at bitbucket.org (Joshua_Pereyda) Date: Wed, 13 Apr 2016 17:51:39 -0000 Subject: [Pytest-commit] Issue #325: Using sudo in commands ignores basepython (hpk42/tox) Message-ID: <20160413175139.26569.78678@celery-worker-103.ash1.bb-inf.net> New issue 325: Using sudo in commands ignores basepython https://bitbucket.org/hpk42/tox/issues/325/using-sudo-in-commands-ignores-basepython Joshua_Pereyda: ## Problem When using sudo in the commands list, the system default python is used instead of tox's basepython. ## Example ### tox.ini ``` #!ini [tox] envlist = py27,py34 [testenv] whitelist_externals=sudo commands = python -c "import sys; print(sys.version)" sudo python -c "import sys; print(sys.version)" ``` ### Output Notice that `sudo python` runs 2.7, regardless of tox's specification. Plain `python` switches as expected. ``` #! $ tox GLOB sdist-make: /home/joshpere/code/tox-isolate/setup.py py27 recreate: /home/joshpere/code/tox-isolate/.tox/py27 py27 inst: /home/joshpere/code/tox-isolate/.tox/dist/boofuzz-0.0.3.dev13.zip py27 installed: backports.ssl-match-hostname==3.5.0.1,boofuzz==0.0.3.dev13,certifi==2016.2.28,Flask==0.10.1,future==0.15.2,impacket==0.9.14,itsdangerous==0.24,Jinja2==2.8,MarkupSafe==0.23,pydot2==1.0.33,pyparsing==2.1.1,pyserial==3.0.1,tornado==4.0.2,Werkzeug==0.11.5 py27 runtests: PYTHONHASHSEED='529845781' py27 runtests: commands[0] | python -c import sys; print(sys.version) 2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2] py27 runtests: commands[1] | sudo python -c import sys; print(sys.version) 2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2] py34 inst-nodeps: /home/joshpere/code/tox-isolate/.tox/dist/boofuzz-0.0.3.dev13.zip py34 installed: boofuzz==0.0.3.dev13,certifi==2016.2.28,Flask==0.10.1,future==0.15.2,impacket==0.9.14,itsdangerous==0.24,Jinja2==2.8,MarkupSafe==0.23,pydot2==1.0.33,pyparsing==2.1.1,pyserial==3.0.1,tornado==4.0.2,Werkzeug==0.11.5 py34 runtests: PYTHONHASHSEED='529845781' py34 runtests: commands[0] | python -c import sys; print(sys.version) 3.4.3 (default, Oct 14 2015, 20:28:29) [GCC 4.8.4] py34 runtests: commands[1] | sudo python -c import sys; print(sys.version) 2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2] ____________________________________________________________________________________ summary _____________________________________________________________________________________ py27: commands succeeded py34: commands succeeded congratulations :) ``` ## Conclusion Any ideas how to workaround? I'm not sure how tox controls what `python` is, but that somehow needs to get passed through sudo. Didn't work: - `sudo -E` - `sudo -E -H` -------------- next part -------------- An HTML attachment was scrubbed... URL: From issues-reply at bitbucket.org Thu Apr 14 04:54:45 2016 From: issues-reply at bitbucket.org (Cosimo Lupo) Date: Thu, 14 Apr 2016 08:54:45 -0000 Subject: [Pytest-commit] Issue #326: OSError 'Not a directory' when creating env on Jython 2.7.0 (hpk42/tox) Message-ID: <20160414085445.51527.35950@celery-worker-102.ash1.bb-inf.net> New issue 326: OSError 'Not a directory' when creating env on Jython 2.7.0 https://bitbucket.org/hpk42/tox/issues/326/oserror-not-a-directory-when-creating-env Cosimo Lupo: Hi, I cannot use tox with Jython. I'm using the latest tox 2.3.1, and Jython 2.7.0 on OS X 10.10.5 with Java 1.7.0_79. I tried to clone this repository and run the test suite using jython. Below is the output from test_venv.py::test_create that shows my issue. It seems that the subprocess call to `virtualenv` command that creates the new tox environment is failing because a `listdir` call in `session._initlogpath` raises `OSError` because the `envlogdir` (where the output from the subprocess is to be logged) does not exist. If I browse the `.tox` directory in Finder, I can see there is no `{envdir}/log` subfolder. Thank you for your support. Cosimo ``` (jython-venv) cosimolupo at Cosimo-MBP ~/Documents/Github/tox $ py.test -v tests/test_venv.py::test_create ============================= test session starts ============================== platform java1.7.0_79 -- Python 2.7.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1 -- /Users/cosimolupo/Documents/Github/fonttools/jython-venv/bin/jython cachedir: .cache tox comes from: '/Users/cosimolupo/Documents/Github/tox/tox/__init__$py.class' rootdir: /Users/cosimolupo/Documents/Github/tox, inifile: tox.ini collected 28 items tests/test_venv.py::test_create FAILED =================================== FAILURES =================================== _________________________________ test_create __________________________________ monkeypatch = <_pytest.monkeypatch.monkeypatch instance at 0x69> mocksession = newconfig = def test_create(monkeypatch, mocksession, newconfig): config = newconfig([], """ [testenv:py123] """) envconfig = config.envconfigs['py123'] venv = VirtualEnv(envconfig, session=mocksession) assert venv.path == envconfig.envdir assert not venv.path.check() action = mocksession.newaction(venv, "getenv") > tox_testenv_create(action=action, venv=venv) tests/test_venv.py:60: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tox/venv.py:395: in tox_testenv_create venv._pcall(args, venv=False, action=action, cwd=basepath) tox/venv.py:361: in _pcall return action.popen(args, cwd=cwd, env=env, tox/session.py:121: in popen fout = self._initlogpath(self.id) tox/session.py:107: in _initlogpath l = logdir.listdir("%s-*" % actionid) tox/session.py:107: in _initlogpath l = logdir.listdir("%s-*" % actionid) ../fonttools/jython-venv/Lib/site-packages/py/_path/local.py:388: in listdir names = py.error.checked_call(os.listdir, self.strpath) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = func = args = ('/private/var/folders/jb/rjz76yw92w7144mwqg119jnm0000gn/T/pytest-of-cosimolupo/pytest-3/test_create0/.tox/py123/log',) kwargs = {}, __tracebackhide__ = False, cls = value = OSError(20, 'Not a directory'), tb = errno = 20 def checked_call(self, func, *args, **kwargs): """ call a function and raise an errno-exception if applicable. """ __tracebackhide__ = True try: return func(*args, **kwargs) except self.Error: raise except (OSError, EnvironmentError): cls, value, tb = sys.exc_info() if not hasattr(value, 'errno'): raise __tracebackhide__ = False errno = value.errno try: if not isinstance(value, WindowsError): raise NameError except NameError: # we are not on Windows, or we got a proper OSError cls = self._geterrnoclass(errno) else: try: cls = self._geterrnoclass(_winerrnomap[errno]) except KeyError: raise value > raise cls("%s%r" % (func.__name__, args)) E ENOTDIR: [Not a directory]: listdir('/private/var/folders/jb/rjz76yw92w7144mwqg119jnm0000gn/T/pytest-of-cosimolupo/pytest-3/test_create0/.tox/py123/log',) ../fonttools/jython-venv/Lib/site-packages/py/_error.py:84: ENOTDIR =========================== 1 failed in 2.31 seconds =========================== ``` -------------- next part -------------- An HTML attachment was scrubbed... URL: From issues-reply at bitbucket.org Thu Apr 14 10:04:47 2016 From: issues-reply at bitbucket.org (Bixel Gitzenshigels) Date: Thu, 14 Apr 2016 14:04:47 -0000 Subject: [Pytest-commit] Issue #327: toxworkdir does not expanduser properly (hpk42/tox) Message-ID: <20160414140447.12546.29200@celery-worker-103.ash1.bb-inf.net> New issue 327: toxworkdir does not expanduser properly https://bitbucket.org/hpk42/tox/issues/327/toxworkdir-does-not-expanduser-properly Bixel Gitzenshigels: I attempted to use a tilda in my `toxworkdir` as below within my tox.ini file: toxworkdir = ~/.envs/tox/project_name/ However, much to my surprise, my tox was built under my project: {toxinitdir}/~/.envs/tox/project_name -------------- next part -------------- An HTML attachment was scrubbed... URL: From issues-reply at bitbucket.org Wed Apr 20 12:18:54 2016 From: issues-reply at bitbucket.org (Sorin Sbarnea) Date: Wed, 20 Apr 2016 16:18:54 -0000 Subject: [Pytest-commit] Issue #328: tox environments gets broken if you run the same code across several platforms (hpk42/tox) Message-ID: <20160420161854.38258.6149@celery-worker-102.ash1.bb-inf.net> New issue 328: tox environments gets broken if you run the same code across several platforms https://bitbucket.org/hpk42/tox/issues/328/tox-environments-gets-broken-if-you-run Sorin Sbarnea: While doing development it is very easy to mount your code on different VMs but this will bring you a really nasty surprise: the virtual environments created by tox cannot be used cross platform and your will start getting errors such "bad interpreter" For example my main development machine is OS X and I do run two VMs using Parallels, one with Windows and one with Ubuntu. Both of them are mounting my entire home directory so I can access my source-code on each of them without having to synchronize it. We need to find a way to prevent this from happening, for example if I can convince tox to include the platform name in the environment directory name, this would not happen. Example: ``` .tox/py26.linux/ .tox/py26.osx/ .tox/py26.windows/ .tox/py27.linux/ ``` -------------- next part -------------- An HTML attachment was scrubbed... URL: From issues-reply at bitbucket.org Wed Apr 27 08:58:39 2016 From: issues-reply at bitbucket.org (Arthur Lutz) Date: Wed, 27 Apr 2016 12:58:39 -0000 Subject: [Pytest-commit] Issue #329: Unittesting with mock objects fails in tox with @patch decorator (hpk42/tox) Message-ID: <20160427125839.47806.27200@celery-worker-102.ash1.bb-inf.net> New issue 329: Unittesting with mock objects fails in tox with @patch decorator https://bitbucket.org/hpk42/tox/issues/329/unittesting-with-mock-objects-fails-in-tox Arthur Lutz: I have some unittests that work fine when directly run with python (python -R -m coverage run -m pytest /test), The code looks like this ``` @patch('elasticsearch.client.Elasticsearch.index') def test_es_hooks_modify(self, index): ``` and generates the following error when run in tox ``` /usr/lib/python2.7/dist-packages/mock/mock.py:721: AttributeError ___________________________________________________________ ExportElasticSearchTC.test_es_hooks_modify _____________________________________________________ args = (, ), keywargs = {} extra_args = [], entered_patchers = [] exc_info = (, AttributeError('assert_called',), ) patching = , arg = @wraps(func) def patched(*args, **keywargs): extra_args = [] entered_patchers = [] exc_info = tuple() try: for patching in patched.patchings: arg = patching.__enter__() entered_patchers.append(patching) if patching.attribute_name is not None: keywargs.update(arg) elif patching.new is DEFAULT: extra_args.append(arg) args += tuple(extra_args) > return func(*args, **keywargs) ``` Reading the mock code, I try out adding unsafe ``` @patch('elasticsearch.client.Elasticsearch.index', unsafe=True) def test_es_hooks_modify(self, index): ``` And this works in both tox and directly from python. Is this a mock bug ? a pytest bug ? is tox doing something that might affect the way mock works ? Do you need extra context ? -------------- next part -------------- An HTML attachment was scrubbed... URL: