Skip to content
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

test_cherrypy.py fails with py3 #72

Closed
idella opened this issue Jan 9, 2013 · 3 comments
Closed

test_cherrypy.py fails with py3 #72

idella opened this issue Jan 9, 2013 · 3 comments

Comments

@idella
Copy link

idella commented Jan 9, 2013

This appears to have been in place for some time. I only picked it up in the process of preparing a version bump, to 0.2.4, requested by another, gentoo

platform linux2 -- Python 3.2.3 -- pytest-2.2.4
collected 22 items

test/test_cherrypy.py F
test/test_frame.py ............
test/test_stream.py .........

=================================== FAILURES ===================================
___________________________ CherryPyTest.test_plugin ___________________________

self = <test.test_cherrypy.CherryPyTest testMethod=test_plugin>

def test_plugin(self):
    self.assertEquals(len(cherrypy.engine.websocket.pool), 0)

    s = FakeSocket()
    h = EchoWebSocket(s, [], [])
    cherrypy.engine.publish('handle-websocket', h, ('127.0.0.1', 0))
    self.assertEquals(len(cherrypy.engine.websocket.pool), 1)
  k = cherrypy.engine.websocket.pool.keys()[0]

E TypeError: 'dict_keys' object does not support indexing

test/test_cherrypy.py:68: TypeError
===================== 1 failed, 21 passed in 0.67 seconds ======================

  • ERROR: dev-python/ws4py-0.2.3 failed (test phase):

You can tell me if this is coming from ws4py here of from cherrypy itself. Holds true for
cherrypy-3.2.0 - 3.2.2

@Lawouach
Copy link
Owner

Lawouach commented Jan 9, 2013

Likely from ws4py. I assume you are using Python 3 but which release precisely. Could you also try ws4py 0.2.4 instead pleease?

@idella
Copy link
Author

idella commented Jan 9, 2013

========================== 22 passed in 0.39 seconds ===========================

  • Testing of dev-python/ws4py-0.2.4 with CPython 3.2...
    ============================= test session starts ==============================
    platform linux2 -- Python 3.2.3 -- pytest-2.2.4
    collected 22 items

test/test_cherrypy.py F
test/test_frame.py ............
test/test_stream.py .........

=================================== FAILURES ===================================
___________________________ CherryPyTest.test_plugin ___________________________

self = <test.test_cherrypy.CherryPyTest testMethod=test_plugin>

def test_plugin(self):
    self.assertEquals(len(cherrypy.engine.websocket.pool), 0)

    s = FakeSocket()
    h = EchoWebSocket(s, [], [])
    cherrypy.engine.publish('handle-websocket', h, ('127.0.0.1', 0))
    self.assertEquals(len(cherrypy.engine.websocket.pool), 1)
  k = cherrypy.engine.websocket.pool.keys()[0]

E TypeError: 'dict_keys' object does not support indexing

test/test_cherrypy.py:68: TypeError
===================== 1 failed, 21 passed in 0.61 seconds ======================

  • ERROR: dev-python/ws4py-0.2.4 failed (test phase):
  • Testing failed with CPython 3.2 in testing() function

I intended ws4py 0.2.4 actually.
scimath # python -V
Python 3.2.3
Is there any further prcision to 3.2.3?

thx

@idella
Copy link
Author

idella commented Jan 11, 2013

Lawouach; very good, thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants