[Pytest-commit] Issue #747: flakes test fail (pytest-dev/pytest)

Florian Bruhin issues-reply at bitbucket.org
Tue May 19 21:29:47 CEST 2015


New issue 747: flakes test fail
https://bitbucket.org/pytest-dev/pytest/issue/747/flakes-test-fail

Florian Bruhin:

I just tried running all tests via tox, and the flakes test fail for me:

```
=================================================== FAILURES ===================================================
________________________________________________ pyflakes-check ________________________________________________
.tox/flakes/lib/python3.4/site-packages/pluggy.py:724: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
.tox/flakes/lib/python3.4/site-packages/pluggy.py:338: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
.tox/flakes/lib/python3.4/site-packages/pluggy.py:333: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
.tox/flakes/lib/python3.4/site-packages/pluggy.py:595: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
.tox/flakes/lib/python3.4/site-packages/pluggy.py:253: in _wrapped_call
    return call_outcome.get_result()
.tox/flakes/lib/python3.4/site-packages/pluggy.py:278: in get_result
    raise ex[1].with_traceback(ex[2])
.tox/flakes/lib/python3.4/site-packages/pluggy.py:264: in __init__
    self.result = func()
.tox/flakes/lib/python3.4/site-packages/pluggy.py:596: in execute
    res = hook_impl.function(*args)
.tox/flakes/lib/python3.4/site-packages/_pytest/runner.py:90: in pytest_runtest_call
    item.runtest()
.tox/flakes/lib/python3.4/site-packages/pytest_flakes.py:75: in runtest
    found_errors, out = check_file(self.fspath, self.flakesignore)
.tox/flakes/lib/python3.4/site-packages/pytest_flakes.py:124: in check_file
    codeString = path.read()
.tox/flakes/lib/python3.4/site-packages/py/_path/common.py:133: in read
    return f.read()
.tox/flakes/lib/python3.4/encodings/ascii.py:26: in decode
    return codecs.ascii_decode(input, self.errors)[0]
E   UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 6798: ordinal not in range(128)
________________________________________________ pyflakes-check ________________________________________________
/home/florian/proj/pytest/testing/test_capture.py:31: UndefinedName
undefined name 'unicode'
/home/florian/proj/pytest/testing/test_capture.py:38: UndefinedName
undefined name 'unicode'
/home/florian/proj/pytest/testing/test_capture.py:39: UndefinedName
undefined name 'unicode'
/home/florian/proj/pytest/testing/test_capture.py:583: UndefinedName
undefined name 'unicode'
/home/florian/proj/pytest/testing/test_capture.py:587: UndefinedName
undefined name 'unicode'
________________________________________________ pyflakes-check ________________________________________________
/home/florian/proj/pytest/testing/test_collection.py:36: UndefinedName
undefined name 'cmp'
________________________________________________ pyflakes-check ________________________________________________
.tox/flakes/lib/python3.4/site-packages/pluggy.py:724: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
.tox/flakes/lib/python3.4/site-packages/pluggy.py:338: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
.tox/flakes/lib/python3.4/site-packages/pluggy.py:333: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
.tox/flakes/lib/python3.4/site-packages/pluggy.py:595: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
.tox/flakes/lib/python3.4/site-packages/pluggy.py:253: in _wrapped_call
    return call_outcome.get_result()
.tox/flakes/lib/python3.4/site-packages/pluggy.py:278: in get_result
    raise ex[1].with_traceback(ex[2])
.tox/flakes/lib/python3.4/site-packages/pluggy.py:264: in __init__
    self.result = func()
.tox/flakes/lib/python3.4/site-packages/pluggy.py:596: in execute
    res = hook_impl.function(*args)
.tox/flakes/lib/python3.4/site-packages/_pytest/runner.py:90: in pytest_runtest_call
    item.runtest()
.tox/flakes/lib/python3.4/site-packages/pytest_flakes.py:75: in runtest
    found_errors, out = check_file(self.fspath, self.flakesignore)
.tox/flakes/lib/python3.4/site-packages/pytest_flakes.py:124: in check_file
    codeString = path.read()
.tox/flakes/lib/python3.4/site-packages/py/_path/common.py:133: in read
    return f.read()
.tox/flakes/lib/python3.4/encodings/ascii.py:26: in decode
    return codecs.ascii_decode(input, self.errors)[0]
E   UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 17709: ordinal not in range(128)
________________________________________________ pyflakes-check ________________________________________________
/home/florian/proj/pytest/testing/python/collect.py:489: UndefinedName
undefined name 'cmp'
==================================== 1144 tests deselected by "-m 'flakes'" ====================================
============================= 5 failed, 61 passed, 1144 deselected in 2.81 seconds =============================
```

Random guesses without investigating more:

- Maybe `passenv` for `LC_ALL` or so should be set in `tox.ini` since the new tox version doesn't pass environment variables?
- I'm on Archlinux which uses python3 for `/usr/bin/python` - it smells like the `cmp`/`unicode` failures are because it's run with python3 instead of 2?




More information about the pytest-commit mailing list