$ ~/jythondev/jython27/dist/bin/py.test-jython ============================= test session starts ============================== platform java1.7.0_21 -- Python 2.7.0 -- py-1.4.26 -- pytest-2.6.4 collected 425 items tests/test_compat.py .. tests/test_datastructures.py .............................................s tests/test_debug.py ..F...........F tests/test_exceptions.py ...................... tests/test_formparser.py ................... tests/test_http.py ................................. tests/test_internal.py ... tests/test_local.py ........ tests/test_routing.py .................................................. tests/test_security.py .F.F tests/test_serving.py sssssssssTraceback (most recent call last): File "/private/var/folders/kk/yrwpx1_x7ll3mn4mvqym2lv40000gn/T/pytest-0/test_monkeypached_sleep0/app/test.py", line 11, in from werkzeug._reloader import ReloaderLoop ImportError: No module named werkzeug._reloader F tests/test_test.py ............................... tests/test_urls.py ......................................... tests/test_utils.py .................... tests/test_wrappers.py ............................................... tests/test_wsgi.py .F..................... tests/contrib/test_atom.py . tests/contrib/test_cache.py .......................... tests/contrib/test_fixers.py ....... tests/contrib/test_iterio.py ....ss tests/contrib/test_securecookie.py .. tests/contrib/test_sessions.py ..... tests/contrib/test_wrappers.py ... tests/res/test.txt . =================================== FAILURES =================================== _______________________ TestDebugRepr.test_mapping_repr ________________________ self = def test_mapping_repr(self): assert debug_repr({}) == u'{}' assert debug_repr({'foo': 42}) == ( u'{\'foo\'' u': 42' u'}' ) > assert debug_repr(dict(zip(range(10), [None] * 10))) == ( u'{0: None, 1: None, 2: None, 3: None, 4: None, 5: None, 6: None, 7: None, 8: None, 9: None}' ) E assert '{}' == '{}' E Detailed information truncated, use "-vv" to show tests/test_debug.py:59: AssertionError _____________________ TestTraceback.test_filename_encoding _____________________ self = tmpdir = local(u'/private/var/folders/kk/yrwpx1_x7ll3mn4mvqym2lv40000gn/T/pytest-0/test_filename_encoding0') monkeypatch = <_pytest.monkeypatch.monkeypatch instance at 0xd5> def test_filename_encoding(self, tmpdir, monkeypatch): > moduledir = tmpdir.mkdir('föö') tests/test_debug.py:217: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../jythondev/jython27/dist/Lib/site-packages/py/_path/local.py:436: in mkdir p = self.join(*args) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = local(u'/private/var/folders/kk/yrwpx1_x7ll3mn4mvqym2lv40000gn/T/pytest-0/test_filename_encoding0') args = ('f\xc3\xb6\xc3\xb6',), kwargs = {}, sep = '/' strargs = ['f\xc3\xb6\xc3\xb6'], arg = 'f\xc3\xb6\xc3\xb6' strpath = '/private/var/folders/kk/yrwpx1_x7ll3mn4mvqym2lv40000gn/T/pytest-0/test_filename_encoding0' def join(self, *args, **kwargs): """ return a new path by appending all 'args' as path components. if abs=1 is used restart from root if any of the args is an absolute path. """ sep = self.sep strargs = [getattr(arg, "strpath", arg) for arg in args] strpath = self.strpath if kwargs.get('abs'): newargs = [] for arg in reversed(strargs): if isabs(arg): strpath = arg strargs = newargs break newargs.insert(0, arg) for arg in strargs: arg = arg.strip(sep) if iswin32: # allow unix style paths even on windows. arg = arg.strip('/') arg = arg.replace('/', sep) > strpath = strpath + sep + arg E UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128) ../../jythondev/jython27/dist/Lib/site-packages/py/_path/local.py:329: UnicodeDecodeError ____________________________ test_password_hashing _____________________________ def test_password_hashing(): > hash0 = generate_password_hash('default') tests/test_security.py:26: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ werkzeug/security.py:229: in generate_password_hash h, actual_method = _hash_internal(method, salt, password) werkzeug/security.py:190: in _hash_internal rv = pbkdf2_hex(password, salt, iterations, _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ data = 'default', salt = 'ONJDDHmv', iterations = 1000, keylen = None hashfunc = def pbkdf2_hex(data, salt, iterations=DEFAULT_PBKDF2_ITERATIONS, keylen=None, hashfunc=None): """Like :func:`pbkdf2_bin`, but returns a hex-encoded string. .. versionadded:: 0.9 :param data: the data to derive. :param salt: the salt for the derivation. :param iterations: the number of iterations. :param keylen: the length of the resulting key. If not provided, the digest size will be used. :param hashfunc: the hash function to use. This can either be the string name of a known hash function, or a function from the hashlib module. Defaults to sha1. """ rv = pbkdf2_bin(data, salt, iterations, keylen, hashfunc) > return to_native(codecs.encode(rv, 'hex_codec')) E TypeError: encode(): 1st arg can't be coerced to org.python.core.PyUnicode werkzeug/security.py:65: TypeError _________________________________ test_pbkdf2 __________________________________ def test_pbkdf2(): def check(data, salt, iterations, keylen, expected): rv = pbkdf2_hex(data, salt, iterations, keylen) assert rv == expected # From RFC 6070 > check('password', 'salt', 1, None, '0c60c80f961f0e71f3a9b524af6012062fe037a6') tests/test_security.py:64: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/test_security.py:60: in check rv = pbkdf2_hex(data, salt, iterations, keylen) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ data = 'password', salt = 'salt', iterations = 1, keylen = None, hashfunc = None def pbkdf2_hex(data, salt, iterations=DEFAULT_PBKDF2_ITERATIONS, keylen=None, hashfunc=None): """Like :func:`pbkdf2_bin`, but returns a hex-encoded string. .. versionadded:: 0.9 :param data: the data to derive. :param salt: the salt for the derivation. :param iterations: the number of iterations. :param keylen: the length of the resulting key. If not provided, the digest size will be used. :param hashfunc: the hash function to use. This can either be the string name of a known hash function, or a function from the hashlib module. Defaults to sha1. """ rv = pbkdf2_bin(data, salt, iterations, keylen, hashfunc) > return to_native(codecs.encode(rv, 'hex_codec')) E TypeError: encode(): 1st arg can't be coerced to org.python.core.PyUnicode werkzeug/security.py:65: TypeError ___________________________ test_monkeypached_sleep ____________________________ tmpdir = local(u'/private/var/folders/kk/yrwpx1_x7ll3mn4mvqym2lv40000gn/T/pytest-0/test_monkeypached_sleep0') def test_monkeypached_sleep(tmpdir): # removing the staticmethod wrapper in the definition of # ReloaderLoop._sleep works most of the time, since `sleep` is a c # function, and unlike python functions which are descriptors, doesn't # become a method when attached to a class. however, if the user has called # `eventlet.monkey_patch` before importing `_reloader`, `time.sleep` is a # python function, and subsequently calling `ReloaderLoop._sleep` fails # with a TypeError. This test checks that _sleep is attached correctly. script = tmpdir.mkdir('app').join('test.py') script.write(textwrap.dedent(''' import time def sleep(secs): pass # simulate eventlet.monkey_patch by replacing the builtin sleep # with a regular function before _reloader is imported time.sleep = sleep from werkzeug._reloader import ReloaderLoop ReloaderLoop()._sleep(0) ''')) > subprocess.check_call(['python', str(script)]) tests/test_serving.py:199: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ popenargs = (['python', '/private/var/folders/kk/yrwpx1_x7ll3mn4mvqym2lv40000gn/T/pytest-0/test_monkeypached_sleep0/app/test.py'],) kwargs = {}, retcode = 1 cmd = ['python', '/private/var/folders/kk/yrwpx1_x7ll3mn4mvqym2lv40000gn/T/pytest-0/test_monkeypached_sleep0/app/test.py'] def check_call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the Popen constructor. Example: check_call(["ls", "-l"]) """ retcode = call(*popenargs, **kwargs) if retcode: cmd = kwargs.get("args") if cmd is None: cmd = popenargs[0] > raise CalledProcessError(retcode, cmd) E CalledProcessError: Command '['python', '/private/var/folders/kk/yrwpx1_x7ll3mn4mvqym2lv40000gn/T/pytest-0/test_monkeypached_sleep0/app/test.py']' returned non-zero exit status 1 ../../jythondev/jython27/dist/Lib/subprocess.py:518: CalledProcessError _________________________ test_shared_data_middleware __________________________ tmpdir = local(u'/private/var/folders/kk/yrwpx1_x7ll3mn4mvqym2lv40000gn/T/pytest-0/test_shared_data_middleware0') def test_shared_data_middleware(tmpdir): def null_application(environ, start_response): start_response('404 NOT FOUND', [('Content-Type', 'text/plain')]) yield b'NOT FOUND' test_dir = str(tmpdir) with open(path.join(test_dir, to_native(u'äöü', 'utf-8')), 'w') as test_file: test_file.write(u'FOUND') app = wsgi.SharedDataMiddleware(null_application, { '/': path.join(path.dirname(__file__), 'res'), '/sources': path.join(path.dirname(__file__), 'res'), '/pkg': ('werkzeug.debug', 'shared'), '/foo': test_dir }) for p in '/test.txt', '/sources/test.txt', '/foo/äöü': > app_iter, status, headers = run_wsgi_app(app, create_environ(p)) tests/test_wsgi.py:47: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ werkzeug/test.py:867: in run_wsgi_app app_iter = app(environ, start_response) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = environ = {'CONTENT_LENGTH': '0', 'CONTENT_TYPE': '', 'HTTP_HOST': 'localhost', 'PATH_INFO': '/foo/\xc3\xa4\xc3\xb6\xc3\xbc', ...} start_response = def __call__(self, environ, start_response): cleaned_path = get_path_info(environ) if PY2: > cleaned_path = cleaned_path.encode(sys.getfilesystemencoding()) E UnicodeEncodeError: 'ascii' codec can't encode characters in position 5-7: ordinal not in range(128) werkzeug/wsgi.py:570: UnicodeEncodeError ============== 6 failed, 407 passed, 12 skipped in 10.90 seconds ===============