Skip to content

flakes test fail #747

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pytestbot opened this issue May 19, 2015 · 5 comments
Closed

flakes test fail #747

pytestbot opened this issue May 19, 2015 · 5 comments
Assignees
Labels
good first issue easy issue that is friendly to new contributor type: bug problem that needs to be addressed

Comments

@pytestbot
Copy link
Contributor

Originally reported by: Florian Bruhin (BitBucket: The-Compiler, GitHub: The-Compiler)


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?

@pytestbot
Copy link
Contributor Author

Original comment by Floris Bruynooghe (BitBucket: flub, GitHub: flub):


Yes, I noticed the unicode failures when running flake with python3 as well during the 2.7.1 release (but decided to ignore them for the release). The others are new to me but then I wasn't using the very latest tox. This bugreport should be a good reminder to sort them out soon!

@pytestbot
Copy link
Contributor Author

Original comment by Florian Bruhin (BitBucket: The-Compiler, GitHub: The-Compiler):


Adding passenv = LANG or setenv = LANG=C.UTF-8 to [testenv:flakes] in tox.ini fixes the UnicodeDecodeErrors.

Adding basepython = python2 fixes the rest for me.

@pytestbot
Copy link
Contributor Author

Original comment by Florian Bruhin (BitBucket: The-Compiler, GitHub: The-Compiler):


The UnicodeDecodeError seems like an issue with pytest-flakes to me - passing the environment variables (so Python uses UTF-8 by default) is more like a workaround.

I opened an issue here: asmeurer/pytest-flakes#6

@pytestbot pytestbot added the type: bug problem that needs to be addressed label Jun 15, 2015
@The-Compiler The-Compiler self-assigned this Jul 8, 2015
@flub flub added the task label Jul 24, 2015
@RonnyPfannschmidt RonnyPfannschmidt added the good first issue easy issue that is friendly to new contributor label Jul 25, 2015
@maartenq
Copy link

this seems to have to do with issues around Tox 2.0 and seemed to be fix. At the europython 2015 sprint no one can reproduce the issue.

@The-Compiler
Copy link
Member

Yeah, I can confirm it works fine for me as well - thanks for triaging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue easy issue that is friendly to new contributor type: bug problem that needs to be addressed
Projects
None yet
Development

No branches or pull requests

6 participants