Skip to content

Instantly share code, notes, and snippets.

@d0ugal
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save d0ugal/a14f58f679b22d36e2bd to your computer and use it in GitHub Desktop.
Save d0ugal/a14f58f679b22d36e2bd to your computer and use it in GitHub Desktop.
[tox]
envlist = py26,py27,py33,py34
skipsdist = true
[testenv]
commands=
python -c "import codecs, locale; l = codecs.lookup(locale.getpreferredencoding()).name; assert l == 'utf-8', l"
@d0ugal
Copy link
Author

d0ugal commented May 14, 2015

If I add the following it works, but adding my specific locale is wrong.

setenv =
    LANG=en_GB.utf8

If I run it manually like this, it works as expected (no failed assert).

./.tox/py27/bin/python -c "import codecs, locale; l = codecs.lookup(locale.getpreferredencoding()).name; assert l == 'utf-8', l"
./.tox/py34/bin/python -c "import codecs, locale; l = codecs.lookup(locale.getpreferredencoding()).name; assert l == 'utf-8', l"

@d0ugal
Copy link
Author

d0ugal commented May 14, 2015

The output of running the above is this:

tox
GLOB sdist-make: /tmp/testing/setup.py
py26 inst-nodeps: /tmp/testing/.tox/dist/test-0.0.0.zip
py26 installed: mkdocs==0.0.0,test==0.0.0
py26 runtests: PYTHONHASHSEED='1839941553'
py26 runtests: commands[0] | python -c import codecs, locale; l = codecs.lookup(locale.getpreferredencoding()).name; assert l == 'utf-8', l
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AssertionError: ascii
ERROR: InvocationError: "/tmp/testing/.tox/py26/bin/python -c import codecs, locale; l = codecs.lookup(locale.getpreferredencoding()).name; assert l == 'utf-8', l"
py27 inst-nodeps: /tmp/testing/.tox/dist/test-0.0.0.zip
py27 installed: mkdocs==0.0.0,test==0.0.0
py27 runtests: PYTHONHASHSEED='1839941553'
py27 runtests: commands[0] | python -c import codecs, locale; l = codecs.lookup(locale.getpreferredencoding()).name; assert l == 'utf-8', l
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AssertionError: ascii
ERROR: InvocationError: "/tmp/testing/.tox/py27/bin/python -c import codecs, locale; l = codecs.lookup(locale.getpreferredencoding()).name; assert l == 'utf-8', l"
py33 inst-nodeps: /tmp/testing/.tox/dist/test-0.0.0.zip
py33 installed: mkdocs==0.0.0,test==0.0.0
py33 runtests: PYTHONHASHSEED='1839941553'
py33 runtests: commands[0] | python -c import codecs, locale; l = codecs.lookup(locale.getpreferredencoding()).name; assert l == 'utf-8', l
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AssertionError: ascii
ERROR: InvocationError: "/tmp/testing/.tox/py33/bin/python -c import codecs, locale; l = codecs.lookup(locale.getpreferredencoding()).name; assert l == 'utf-8', l"
py34 inst-nodeps: /tmp/testing/.tox/dist/test-0.0.0.zip
py34 installed: mkdocs==0.0.0,test==0.0.0
py34 runtests: PYTHONHASHSEED='1839941553'
py34 runtests: commands[0] | python -c import codecs, locale; l = codecs.lookup(locale.getpreferredencoding()).name; assert l == 'utf-8', l
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AssertionError: ascii
ERROR: InvocationError: "/tmp/testing/.tox/py34/bin/python -c import codecs, locale; l = codecs.lookup(locale.getpreferredencoding()).name; assert l == 'utf-8', l"
______________________________________________________________ summary _______________________________________________________________
ERROR:   py26: commands failed
ERROR:   py27: commands failed
ERROR:   py33: commands failed
ERROR:   py34: commands failed

@RonnyPfannschmidt
Copy link

needs a setenv for the locale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment