Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

test_css21.py flounders under py2.7 #4

Closed
idella opened this Issue · 6 comments

2 participants

@idella
 * python2.7: running distutils-r1_run_phase python_test
=================== test session starts ===================================
platform linux2 -- Python 2.7.3 -- pytest-2.3.4


collected 0 items / 1 errors

========================================================= ERRORS =========================================================
______________________________________ ERROR collecting tinycss/tests/test_css21.py ______________________________________
/usr/lib64/python2.7/site-packages/_pytest/runner.py:121: in __init__
>               self.result = func()
/usr/lib64/python2.7/site-packages/_pytest/main.py:366: in _memocollect
>       return self._memoizedcall('_collected', lambda: list(self.collect()))
/usr/lib64/python2.7/site-packages/_pytest/main.py:287: in _memoizedcall
>           res = function()
/usr/lib64/python2.7/site-packages/_pytest/main.py:366: in <lambda>
>   return self._memoizedcall('_collected', lambda: list(self.collect()))
/usr/lib64/python2.7/site-packages/_pytest/python.py:348: in collect
>       return super(Module, self).collect()
/usr/lib64/python2.7/site-packages/_pytest/python.py:281: in collect
>                   res = self.makeitem(name, obj)
/usr/lib64/python2.7/site-packages/_pytest/python.py:293: in makeitem
>           collector=self, name=name, obj=obj)
/usr/lib64/python2.7/site-packages/_pytest/main.py:157: in call_matching_hooks
>       return hookmethod.pcall(plugins, **kwargs)
/usr/lib64/python2.7/site-packages/_pytest/core.py:426: in pcall
>       return self._docall(methods, kwargs)
/usr/lib64/python2.7/site-packages/_pytest/core.py:433: in _docall
>           res = mc.execute()
/usr/lib64/python2.7/site-packages/_pytest/core.py:351: in execute
>           res = method(**kwargs)
/usr/lib64/python2.7/site-packages/_pytest/python.py:185: in pytest_pycollect_makeitem
>               return list(collector._genfunctions(name, obj))
/usr/lib64/python2.7/site-packages/_pytest/python.py:309: in _genfunctions
>       gentesthook.pcall(plugins, metafunc=metafunc)
/usr/lib64/python2.7/site-packages/_pytest/core.py:426: in pcall
>       return self._docall(methods, kwargs)
/usr/lib64/python2.7/site-packages/_pytest/core.py:433: in _docall
>           res = mc.execute()
/usr/lib64/python2.7/site-packages/_pytest/core.py:351: in execute
>           res = method(**kwargs)
/usr/lib64/python2.7/site-packages/_pytest/python.py:105: in pytest_generate_tests
>           metafunc.parametrize(*marker.args, **marker.kwargs)
/usr/lib64/python2.7/site-packages/_pytest/python.py:680: in parametrize
>           ids = idmaker(argnames, argvalues)
/usr/lib64/python2.7/site-packages/_pytest/python.py:736: in idmaker
>           idlist.append("-".join(this_id))
E           UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 9: ordinal not in range(128)
================================================ 1 error in 0.22 seconds =================================================

 $ python -V;  Python 2.7.3
py3.2 sees it pass, and also pypy2.0

* python3.2: running 

platform linux2 -- Python 3.2.3 -- pytest-2.3.4
collected 103 items

tinycss/tests/test_css21.py .......................................................................................................

So this error from test_css21.py is somewhat odd being py2.7 specific, it's a collection error by test_css21.py which is the stipulated collector I gather. I've seen this
ordinal not in range(128) a number of times and I gather it's common to a number of faults.

@SimonSapin
Owner

I’m getting the same error on 2.6, 2.7 and pypy. Looking into it.

More than ordinal not in range(128), the important part is UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3. It can happen when bytes and Unicode strings are mixed where they should not. Python 2.x does a lot of implicit between the two, but only in the ASCII range.

@SimonSapin
Owner

I remember running the tests successfully when releasing 0.3. Could be a change in pytest.

@idella

hmm yep, possible, though I kind of hope not since that means passing onto them, we''ll see

@SimonSapin
Owner

Works with older pytest (pre 2.3.0). Discussing with them now.

@idella

great thanks Simon

@SimonSapin
Owner

Reported in https://bitbucket.org/hpk42/pytest/issue/250/unicodedecodeerror-in-idmaker-with

In the meantime, you can use pytest 2.2.4 or some other version before 2.3.0.

@SimonSapin SimonSapin closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.