Some unit tests fails

4 views
Skip to first unread message

Andrey Lebedev

unread,
Apr 9, 2006, 8:16:44 AM4/9/06
to turbo...@googlegroups.com
Hello,

My question is about unit testing policy of turbogears: does failing
of some unit tests considered a problem and should be reported
somewhere, or is it normal situation? Do you require all tests to
pass before commit?

I'm asking because I just run nosetests on svn revision 1110 and got
bunch of errors, all similar to one pasted below.


======================================================================
ERROR: test module testutil in /home/andrey/projects/turbogears/turbogears
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/andrey/tmp/tg/vpython/lib/python2.4/site-packages/nose-0.8.7.2-py2.4.egg/nose/core.py",
line 423, in run
self.setUp()
File "/home/andrey/tmp/tg/vpython/lib/python2.4/site-packages/nose-0.8.7.2-py2.4.egg/nose/core.py",
line 653, in setUp
self.module = self.loader._import(self.module_name, self.path)
File "/home/andrey/tmp/tg/vpython/lib/python2.4/site-packages/nose-0.8.7.2-py2.4.egg/nose/core.py",
line 280, in _import
return nose.importer._import(name, [path])
File "/home/andrey/tmp/tg/vpython/lib/python2.4/site-packages/nose-0.8.7.2-py2.4.egg/nose/importer.py",
line 66, in _import
mod = load_module(fqname, fh, filename, desc)
File "/home/andrey/projects/turbogears/turbogears/testutil.py", line 16, in ?
cherrypy.server.start(serverClass=None, initOnly=True)
File "/home/andrey/tmp/tg/vpython/lib/python2.4/site-packages/CherryPy-2.2.0-py2.4.egg/cherrypy/_cpserver.py",
line 72, in start
Engine.start(self)
File "/home/andrey/tmp/tg/vpython/lib/python2.4/site-packages/CherryPy-2.2.0-py2.4.egg/cherrypy/_cpengine.py",
line 104, in start
self._start()
File "/home/andrey/tmp/tg/vpython/lib/python2.4/site-packages/CherryPy-2.2.0-py2.4.egg/cherrypy/_cpserver.py",
line 78, in _start
Engine._start(self)
File "/home/andrey/tmp/tg/vpython/lib/python2.4/site-packages/CherryPy-2.2.0-py2.4.egg/cherrypy/_cpengine.py",
line 108, in _start
func()
File "/home/andrey/projects/turbogears/turbogears/startup.py", line
204, in startTurboGears
ext.start_extension()
File "/home/andrey/projects/turbogears/turbogears/visit/api.py",
line 64, in start_extension
_manager= _create_visit_manager( timeout )
File "/home/andrey/projects/turbogears/turbogears/visit/api.py",
line 47, in _create_visit_manager
plugin= entrypoint.load()
File "/home/andrey/tmp/tg/vpython/lib/python2.4/site-packages/setuptools-0.6a11-py2.4.egg/pkg_resources.py",
line 1830, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/home/andrey/projects/turbogears/turbogears/visit/sovisit.py",
line 65, in ?
class TG_Visit(SQLObject):
File "/home/andrey/tmp/tg/vpython/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1588-py2.4.egg/sqlobject/declarative.py",
line 108, in __new__
cls.__classinit__(cls, new_attrs)
File "/home/andrey/tmp/tg/vpython/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1588-py2.4.egg/sqlobject/main.py",
line 802, in __classinit__
classregistry.registry(cls.sqlmeta.registry).addClass(cls)
File "/home/andrey/tmp/tg/vpython/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1588-py2.4.egg/sqlobject/classregistry.py",
line 91, in addClass
'__file__', '(unknown)')))
ValueError: class TG_Visit is already in the registry (other class is
<class 'visit.sovisit.TG_Visit'>, from the module visit.sovisit in
/home/andrey/projects/turbogears/turbogears/visit/sovisit.pyc;
attempted new class is <class 'turbogears.visit.sovisit.TG_Visit'>,
from the module turbogears.visit.sovisit in
/home/andrey/projects/turbogears/turbogears/visit/sovisit.pyc)


--
Andrey Lebedev
Software engineer

Alberto Valverde

unread,
Apr 9, 2006, 8:25:44 AM4/9/06
to turbo...@googlegroups.com

On Apr 9, 2006, at 2:16 PM, Andrey Lebedev wrote:

> Hello,
>
> My question is about unit testing policy of turbogears: does failing
> of some unit tests considered a problem and should be reported
> somewhere, or is it normal situation? Do you require all tests to
> pass before commit?
>

No its absolutely not normal and should be reported. Yep, all tests
should pass before commiting.

> I'm asking because I just run nosetests on svn revision 1110 and got
> bunch of errors, all similar to one pasted below.
>
> ======================================================================
> ERROR: test module testutil in /home/andrey/projects/turbogears/
> turbogears
> ----------------------------------------------------------------------


This test doen't fail in m y machine. Are you sure all thirdpart
deps. are up-to-date? Maybe you've got an old version of pysqlite2. I
used to have similar failures until I upgraded.

Alberto

Andrey Lebedev

unread,
Apr 9, 2006, 9:36:57 AM4/9/06
to TurboGears
> This test doen't fail in m y machine. Are you sure all thirdpart
> deps. are up-to-date? Maybe you've got an old version of pysqlite2. I
> used to have similar failures until I upgraded.

What version of pysqlite exactly do I need (can't find any hint on
http://turbogears.org)? I've reinstalled turbogears with all its
dependencies
using 'python setup.py develop' in svn working directory. Then I
installed
pysqlite separately (it wasn't installed by 'setup.py develop') using
'easy_install pysqlite'. easy_install installed version 2.2.0.

After reinstall I get rid of debug output mentioned in
http://groups.google.com/group/turbogears/browse_thread/thread/287e8c5eecd2b585,
but I got other unit test errors, like these:


======================================================================
FAIL: turbogears.tests.test_form_controllers.test_mochikit_everywhere


----------------------------------------------------------------------
Traceback (most recent call last):
File

"/home/andrey/tmp/tg/vpython/lib/python2.4/site-packages/nose-0.8.6-py2.4.egg/nose/core.py",
line 112, in runTest
self.testFunc()
File
"/home/andrey/projects/turbogears/turbogears/tests/test_form_controllers.py",
line 101, in test_mochikit_everywhere
assert "MochiKit.js" in cherrypy.response.body[0]
AssertionError:
-------------------- >> begin captured stdout << ---------------------
09/Apr/2006:16:31:29 HTTP INFO Page handler: <bound method MyRoot.index
of <turbogears.tests.test_form_controllers.MyRoot object at
0xa66280cc>>


Traceback (most recent call last):
File

"/home/andrey/tmp/tg/vpython/lib/python2.4/site-packages/CherryPy-2.2.0-py2.4.egg/cherrypy/_cphttptools.py",
line 106, in _run
self.main()
File
"/home/andrey/tmp/tg/vpython/lib/python2.4/site-packages/CherryPy-2.2.0-py2.4.egg/cherrypy/_cphttptools.py",
line 255, in main
body = page_handler(*virtual_path, **self.params)
File "<string>", line 3, in index
File "/home/andrey/projects/turbogears/turbogears/controllers.py",
line 206, in expose
output = database.run_with_transaction(expose._expose,func, accept,
allow_json, allow_json_from_config,*args, **kw)
File "/home/andrey/projects/turbogears/turbogears/database.py", line
216, in run_with_transaction
retval = func(*args, **kw)
File "<string>", line 5, in _expose
File "/home/andrey/projects/turbogears/turbogears/controllers.py",
line 227, in <lambda>
expose._expose.when(rule)(lambda _func, accept, allow_json,
allow_json_from_config,*args,**kw: _execute_func(
File "/home/andrey/projects/turbogears/turbogears/controllers.py",
line 260, in _execute_func
return _process_output(output, template, format, content_type,
mapping, fragment)
File "/home/andrey/projects/turbogears/turbogears/controllers.py",
line 56, in _process_output
mapping=mapping, content_type=content_type,fragment=fragment)
File "/home/andrey/projects/turbogears/turbogears/view/base.py", line
131, in render
return engine.render(**kw)
File
"/home/andrey/tmp/tg/vpython/lib/python2.4/site-packages/TurboKid-0.9.3-py2.4.egg/turbokid/kidsupport.py",
line 144, in render
data.update(self.get_extra_vars())
File "/home/andrey/projects/turbogears/turbogears/view/base.py", line
318, in stdvars
locale = get_locale(),
File "/home/andrey/projects/turbogears/turbogears/i18n/utils.py",
line 64, in get_locale
locale = get_locale_f()
File
"/home/andrey/projects/turbogears/turbogears/tests/test_i18n.py", line
14, in get_test_locale
return turbogears.config.get('i18n.defaultLocale', 'en')
AttributeError: 'NoneType' object has no attribute 'config'

Request Headers:
Host: localhost
localhost - - [09/Apr/2006:16:31:29] "GET / HTTP/1.1" 500 3020 "" ""
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8"></meta>
<title>500 Internal error</title>
<style type="text/css">
#powered_by {
margin-top: 20px;
border-top: 2px solid black;
font-style: italic;
}

#traceback {
color: red;
}
</style>
</head>
<body>
<h2>500 Internal error</h2>
<p>The server encountered an unexpected condition which
prevented it from fulfilling the request.</p>
<pre id="traceback">Page handler: &lt;bound method MyRoot.index
of &lt;turbogears.tests.test_form_controllers.MyRoot object at
0xa66280cc&gt;&gt;


Traceback (most recent call last):
File

"/home/andrey/tmp/tg/vpython/lib/python2.4/site-packages/CherryPy-2.2.0-py2.4.egg/cherrypy/_cphttptools.py",
line 106, in _run
self.main()
File
"/home/andrey/tmp/tg/vpython/lib/python2.4/site-packages/CherryPy-2.2.0-py2.4.egg/cherrypy/_cphttptools.py",
line 255, in main
body = page_handler(*virtual_path, **self.params)
File "&lt;string&gt;", line 3, in index
File "/home/andrey/projects/turbogears/turbogears/controllers.py",
line 206, in expose
output = database.run_with_transaction(expose._expose,func, accept,
allow_json, allow_json_from_config,*args, **kw)
File "/home/andrey/projects/turbogears/turbogears/database.py", line
216, in run_with_transaction
retval = func(*args, **kw)
File "&lt;string&gt;", line 5, in _expose
File "/home/andrey/projects/turbogears/turbogears/controllers.py",
line 227, in &lt;lambda&gt;
expose._expose.when(rule)(lambda _func, accept, allow_json,
allow_json_from_config,*args,**kw: _execute_func(
File "/home/andrey/projects/turbogears/turbogears/controllers.py",
line 260, in _execute_func
return _process_output(output, template, format, content_type,
mapping, fragment)
File "/home/andrey/projects/turbogears/turbogears/controllers.py",
line 56, in _process_output
mapping=mapping, content_type=content_type,fragment=fragment)
File "/home/andrey/projects/turbogears/turbogears/view/base.py", line
131, in render
return engine.render(**kw)
File
"/home/andrey/tmp/tg/vpython/lib/python2.4/site-packages/TurboKid-0.9.3-py2.4.egg/turbokid/kidsupport.py",
line 144, in render
data.update(self.get_extra_vars())
File "/home/andrey/projects/turbogears/turbogears/view/base.py", line
318, in stdvars
locale = get_locale(),
File "/home/andrey/projects/turbogears/turbogears/i18n/utils.py",
line 64, in get_locale
locale = get_locale_f()
File
"/home/andrey/projects/turbogears/turbogears/tests/test_i18n.py", line
14, in get_test_locale
return turbogears.config.get('i18n.defaultLocale', 'en')
AttributeError: 'NoneType' object has no attribute 'config'

</pre>
<div id="powered_by">
<span>Powered by <a href="http://www.cherrypy.org">CherryPy
2.2.0</a></span>
</div>
</body>
</html>


--------------------- >> end captured stdout << ----------------------


----------------------------------------------------------------------
Ran 177 tests in 7.278s

FAILED (failures=6, errors=64)
Exception in thread VisitManager (most likely raised during interpreter
shutdown):


Traceback (most recent call last):

File "/usr/lib/python2.4/threading.py", line 442, in __bootstrap
File "/home/andrey/projects/turbogears/turbogears/visit/api.py", line
250, in run
exceptions.TypeError: 'NoneType' object is not callable
Unhandled exception in thread started by
Error in sys.excepthook:

Original exception was:
Exception in thread VisitManager (most likely raised during interpreter
shutdown):


Traceback (most recent call last):

File "/usr/lib/python2.4/threading.py", line 442, in __bootstrap
File "/home/andrey/projects/turbogears/turbogears/visit/api.py", line
250, in run
exceptions.TypeError: 'NoneType' object is not callable
Unhandled exception in thread started by
Error in sys.excepthook:

Original exception was:
Exception in thread VisitManager (most likely raised during interpreter
shutdown):


Traceback (most recent call last):

File "/usr/lib/python2.4/threading.py", line 442, in __bootstrap
File "/home/andrey/projects/turbogears/turbogears/visit/api.py", line
250, in run
exceptions.TypeError: 'NoneType' object is not callable
Unhandled exception in thread started by
Error in sys.excepthook:


.... Lots if these ...

Alberto Valverde

unread,
Apr 9, 2006, 9:49:38 AM4/9/06
to turbo...@googlegroups.com

On Apr 9, 2006, at 3:36 PM, Andrey Lebedev wrote:
>
>> This test doen't fail in m y machine. Are you sure all thirdpart
>> deps. are up-to-date? Maybe you've got an old version of pysqlite2. I
>> used to have similar failures until I upgraded.
>
> What version of pysqlite exactly do I need (can't find any hint on
> http://turbogears.org)? I've reinstalled turbogears with all its
> dependencies

I'm not sure. I've got 1.1.6 installed (sorry for the misleading info
in my prev. post where I said I was suing pysqlite2) on Mac OS X.

As I've said, I remember running into similar errors before I
manually installed this version, but I'm not 100% sure this is what
is causing those errors (maybe someone here knows).

Here's my tg-admin info in case it helps:

TurboGears 0.9a4
nose 0.8.3
RuleDispatch 0.5a0.dev-r2100
setuptools 0.6a11
FormEncode 0.4
cElementTree 1.0.5-20051216
PasteScript 0.5
elementtree 1.2.6-20050316
simplejson 1.1
SQLObject 0.7.1dev-r1673
CherryPy 2.2.0
TurboKid 0.9.3
TurboJson 0.9.2dev-r1093
PyProtocols 1.0a0
Cheetah 1.0
PasteDeploy 0.3
Paste 0.5
FormEncode 0.4
kid 0.9
elementtree 1.2.6-20050316

Alberto

Andrey Lebedev

unread,
Apr 10, 2006, 4:31:56 PM4/10/06
to TurboGears
OK, all tests passes in revision 1120. I think something was broken in
1110.

Reply all
Reply to author
Forward
0 new messages