ImportError: No module named test_suite

56 views
Skip to first unread message

Reguillo

unread,
Aug 27, 2010, 5:40:29 AM8/27/10
to Better Python
Hi Thanks for all the hard work.

A few small problems occur when testing the 508 checkout.

First error:

Traceback (most recent call last):
File "test.py", line 2, in <module>
from mext.test_suite import *
ImportError: No module named test_suite


And the second is when I'm trying to run wx_demo.py.


TypeError
"Error when calling the metaclass bases metaclass conflict: the
metaclass of a derived class must be a (non-strict) subclass of the
metaclasses of all its bases"
File: /usr/lib/python2.6/site-packages/mext.hacks-0.10.r2224-py2.6.egg/
mext/classhacks.py, Line: 61

I've used reaction 0.2 before without these problems.


I hope you can help.

Reguillo

unread,
Aug 27, 2010, 5:48:11 AM8/27/10
to Better Python
After installing mext.test>=0.4 another error appears:

Traceback (most recent call last):
File "test.py", line 9, in <module>
'Collections', 'Activity', 'README'
File "/usr/lib/python2.6/site-packages/mext.test-0.4.r2034-py2.6.egg/
mext/test_suite.py", line 52, in add_doctest
globs=self.doctest_globs
File "/usr/lib/python2.6/doctest.py", line 2331, in DocFileTest
doc, path = _load_testfile(path, package, module_relative)
File "/usr/lib/python2.6/doctest.py", line 212, in _load_testfile
filename = _module_relative_path(package, filename)
File "/usr/lib/python2.6/doctest.py", line 356, in
_module_relative_path
raise ValueError, 'Module-relative files may not have absolute
paths'
ValueError: Module-relative files may not have absolute paths

Sergey Schetinin

unread,
Aug 27, 2010, 5:49:29 AM8/27/10
to better...@googlegroups.com
Please post full traceback for the metaclass error.

> --
> Mailing list: http://groups.google.com/group/better-python
> Unsubscribe: better-pytho...@googlegroups.com

--
Best Regards,
Sergey Schetinin

http://self.maluke.com/ -- My articles and open-source stuff
http://www.maluke.com/ -- My commercial software and custom development services

Sergey Schetinin

unread,
Aug 27, 2010, 5:53:19 AM8/27/10
to better...@googlegroups.com
This one seems to be linux-specific. I add doctests by absolute path
and doctest doesn't want that, it checks "if path.startswith('/'):"
which passes on windows. I'll try to come up with a fix.

Sergey Schetinin

unread,
Aug 27, 2010, 6:02:37 AM8/27/10
to better...@googlegroups.com
mext.test>=0.4.1 should fix it (reaction repo updated to depend on that as well)

Reguillo

unread,
Aug 27, 2010, 6:34:15 AM8/27/10
to Better Python
After $ easy_install -U mext.test

Installed /usr/lib/python2.6/site-packages/mext.test-0.4.1.r2378-
py2.6.egg


Than:

$ sudo python setup.py test

running test
running egg_info
writing requirements to Reaction.egg-info/requires.txt
writing Reaction.egg-info/PKG-INFO
writing namespace_packages to Reaction.egg-info/namespace_packages.txt
writing top-level names to Reaction.egg-info/top_level.txt
writing dependency_links to Reaction.egg-info/dependency_links.txt
reading manifest file 'Reaction.egg-info/SOURCES.txt'
writing manifest file 'Reaction.egg-info/SOURCES.txt'
running build_ext
Traceback (most recent call last):
File "setup.py", line 44, in <module>
download_url='http://bitbucket.org/mlk/reaction/get/tip.bz2',
File "/usr/lib/python2.6/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib/python2.6/distutils/dist.py", line 975, in
run_commands
self.run_command(cmd)
File "/usr/lib/python2.6/distutils/dist.py", line 995, in
run_command
cmd_obj.run()
File "/usr/lib/python2.6/site-packages/setuptools/command/test.py",
line 137, in run
self.with_project_on_sys_path(self.run_tests)
File "/usr/lib/python2.6/site-packages/setuptools/command/test.py",
line 122, in with_project_on_sys_path
working_set.__init__()
File "/usr/lib/python2.6/site-packages/coverage/control.py", line
155, in _should_trace
canonical = self.file_locator.canonical_filename(filename)
File "/usr/lib/python2.6/site-packages/coverage/files.py", line 36,
in canonical_filename
if os.path.isabs(f) and not os.path.exists(f):
AttributeError: 'NoneType' object has no attribute 'path'
Error in sys.exitfunc:
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/coverage/control.py", line
155, in _should_trace
canonical = self.file_locator.canonical_filename(filename)
File "/usr/lib/python2.6/site-packages/coverage/files.py", line 36,
in canonical_filename
if os.path.isabs(f) and not os.path.exists(f):
AttributeError: 'NoneType' object has no attribute 'path'


On Aug 27, 12:02 pm, Sergey Schetinin <mal...@gmail.com> wrote:
> mext.test>=0.4.1 should fix it (reaction repo updated to depend on that as well)
>
> On 27 August 2010 12:53, Sergey Schetinin <mal...@gmail.com> wrote:
>
>
>
> > This one seems to be linux-specific. I add doctests by absolute path
> > and doctest doesn't want that, it checks "if path.startswith('/'):"
> > which passes on windows. I'll try to come up with a fix.
>
> >http://self.maluke.com/-- My articles and open-source stuff
> >http://www.maluke.com/-- My commercial software and custom development services
>
> --
> Best Regards,
> Sergey Schetinin
>
> http://self.maluke.com/-- My articles and open-source stuffhttp://www.maluke.com/-- My commercial software and custom development services

Sergey Schetinin

unread,
Aug 27, 2010, 6:38:01 AM8/27/10
to better...@googlegroups.com
Whoa, that's something strange right there. Try updating coverage. If
that doesn't help try disabling test coverage reporting by editing
test.py:

- suite = TestSuite('tests', coverage='_coverage_report', pkg='mext.reaction')
+ suite = TestSuite('tests')

http://self.maluke.com/ -- My articles and open-source stuff
http://www.maluke.com/ -- My commercial software and custom development services

Sergey Schetinin

unread,
Aug 27, 2010, 6:38:45 AM8/27/10
to better...@googlegroups.com
Also, try running test.py directly.

Reguillo

unread,
Aug 27, 2010, 6:52:32 AM8/27/10
to Better Python
Installed /usr/lib/python2.6/site-packages/coverage-3.4b1-py2.6-linux-
i686.egg

After running
line 117, in with_project_on_sys_path
func()
File "/usr/lib/python2.6/site-packages/setuptools/command/test.py",
line 146, in run_tests
testLoader = loader_class()
File "/usr/lib/python2.6/unittest.py", line 816, in __init__
self.parseArgs(argv)
File "/usr/lib/python2.6/unittest.py", line 843, in parseArgs
self.createTests()
File "/usr/lib/python2.6/unittest.py", line 849, in createTests
self.module)
File "/usr/lib/python2.6/unittest.py", line 613, in
loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
File "/usr/lib/python2.6/unittest.py", line 576, in
loadTestsFromName
module = __import__('.'.join(parts_copy))
File "/home/reg/software/reaction_509/reaction/test.py", line 13, in
<module>
suite.add_unittest('test_trellis')
File "/usr/lib/python2.6/site-packages/mext.test-0.4.1.r2378-
py2.6.egg/mext/test_suite.py", line 81, in add_unittest
exec code in mod.__dict__
File "/home/reg/software/reaction_509/reaction/tests/
test_trellis.py", line 6, in <module>
from mext.reaction.tasks import *
File "/home/reg/software/reaction_509/reaction/mext/reaction/
tasks.py", line 4, in <module>
from mext.reaction.celltypes.task import *
File "/home/reg/software/reaction_509/reaction/mext/reaction/
celltypes/task.py", line 5, in <module>
from mext.reaction.eventloop import *
File "/home/reg/software/reaction_509/reaction/mext/reaction/
eventloop.py", line 9, in <module>
class EventLoop(Component, ServiceStub):
File "/usr/lib/python2.6/site-packages/mext.hacks-0.10.r2224-
py2.6.egg/mext/classhacks.py", line 61, in __new__
cls = super(classy_class, meta).__new__(meta, name, bases, cdict)
TypeError: Error when calling the metaclass bases
metaclass conflict: the metaclass of a derived class must be a
(non-strict) subclass of the metaclasses of all its bases


And after running python /home/reg/software/reaction_509/reaction/
test.py:

Traceback (most recent call last):
File "/home/reg/software/reaction_509/reaction/test.py", line 13, in
<module>
suite.add_unittest('test_trellis')
File "/usr/lib/python2.6/site-packages/mext.test-0.4.1.r2378-
py2.6.egg/mext/test_suite.py", line 81, in add_unittest
exec code in mod.__dict__
File "/home/reg/software/reaction_509/reaction/tests/
test_trellis.py", line 6, in <module>
from mext.reaction.tasks import *
File "/home/reg/software/reaction_509/reaction/mext/reaction/
tasks.py", line 4, in <module>
from mext.reaction.celltypes.task import *
File "/home/reg/software/reaction_509/reaction/mext/reaction/
celltypes/task.py", line 5, in <module>
from mext.reaction.eventloop import *
File "/home/reg/software/reaction_509/reaction/mext/reaction/
eventloop.py", line 9, in <module>
class EventLoop(Component, ServiceStub):
File "/usr/lib/python2.6/site-packages/mext.hacks-0.10.r2224-
py2.6.egg/mext/classhacks.py", line 61, in __new__
cls = super(classy_class, meta).__new__(meta, name, bases, cdict)
TypeError: Error when calling the metaclass bases
metaclass conflict: the metaclass of a derived class must be a
(non-strict) subclass of the metaclasses of all its bases


It seems like all these errors relate to classhacks.py.



On Aug 27, 12:38 pm, Sergey Schetinin <mal...@gmail.com> wrote:
> Also, try running test.py directly.
>
> On 27 August 2010 13:38, Sergey Schetinin <mal...@gmail.com> wrote:
>
>
>
> > Whoa, that's something strange right there. Try updating coverage. If
> > that doesn't help try disabling test coverage reporting by editing
> > test.py:
>
> > - suite = TestSuite('tests', coverage='_coverage_report', pkg='mext.reaction')
> > + suite = TestSuite('tests')
>
> >>> >http://self.maluke.com/--My articles and open-source stuff
> >>> >http://www.maluke.com/--My commercial software and custom development services
>
> >>> --
> >>> Best Regards,
> >>> Sergey Schetinin
>
> >>>http://self.maluke.com/--My articles and open-source stuffhttp://www.maluke.com/--My commercial software and custom development services

Reguillo

unread,
Aug 27, 2010, 7:29:21 AM8/27/10
to Better Python
This was related to http://groups.google.com/group/better-python/t/31ed23a6fefa68fe

The tests run now except for one error and one failure:

======================================================================
ERROR: _test_suite.celltypes.tall.test_const_propagation
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/nose/case.py", line 186, in
runTest
self.test(*self.arg)
File "/home/reg/software/reaction_509/reaction/tests/celltypes/
tall.py", line 116, in test_const_propagation
c5 = Rule(c4.read)
File "/home/reg/software/reaction_509/reaction/mext/reaction/
celltypes/track.py", line 24, in __init__
txn.effect(self.become_constant)
File "/home/reg/software/reaction_509/reaction/mext/reaction/stm/
controllers.py", line 68, in __exit__
r = self.gen.next()
File "/home/reg/software/reaction_509/reaction/mext/reaction/stm/
controllers.py", line 122, in init_txn
yield txn
File "/home/reg/software/reaction_509/reaction/mext/reaction/stm/
controllers.py", line 68, in __exit__
r = self.gen.next()
File "/home/reg/software/reaction_509/reaction/mext/reaction/stm/
controllers.py", line 90, in new_txn
yield txn
File "/home/reg/software/reaction_509/reaction/mext/reaction/stm/
controllers.py", line 68, in __exit__
r = self.gen.next()
File "/home/reg/software/reaction_509/reaction/mext/reaction/stm/
controllers.py", line 110, in _new_txn
txn.post_txn() #@@ someday we'll move post_txn outside of the lock
File "/home/reg/software/reaction_509/reaction/mext/reaction/stm/
transactions.py", line 198, in post_txn
self.run_queue(self.effects)
File "/home/reg/software/reaction_509/reaction/mext/reaction/stm/
controllers.py", line 66, in __exit__
r = self.gen.throw(*exc_info)
File "/home/reg/software/reaction_509/reaction/mext/reaction/stm/
controllers.py", line 103, in _new_txn
yield txn
File "/home/reg/software/reaction_509/reaction/mext/reaction/stm/
transactions.py", line 229, in __exit__
super(ScheduledTransaction, self).__exit__(*exc_info)
File "/home/reg/software/reaction_509/reaction/mext/reaction/stm/
transactions.py", line 459, in __exit__
super(LinearUndoLogTransaction, self).__exit__(*exc_info)
File "/home/reg/software/reaction_509/reaction/mext/reaction/stm/
controllers.py", line 103, in _new_txn
yield txn
File "/home/reg/software/reaction_509/reaction/mext/reaction/stm/
transactions.py", line 198, in post_txn
self.run_queue(self.effects)
File "/home/reg/software/reaction_509/reaction/mext/reaction/stm/
transactions.py", line 189, in run_queue
func(*args)
File "/home/reg/software/reaction_509/reaction/mext/reaction/
celltypes/base.py", line 161, in become_constant
listener.become_constant()
File "/home/reg/software/reaction_509/reaction/mext/reaction/
celltypes/base.py", line 158, in become_constant
next_subj = listener.next_subject = link.next_subject
File "/home/reg/software/reaction_509/reaction/mext/reaction/
celltypes/base.py", line 93, in __setattr__
raise AttributeError("Constants can't be changed", self)
AttributeError: ("Constants can't be changed", Constant((1, 1)))



======================================================================
FAIL: Doctest: Internals.txt
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.6/doctest.py", line 2145, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for Internals.txt
File "/home/reg/software/reaction_509/reaction/tests/Internals.txt",
line 0

----------------------------------------------------------------------
File "/home/reg/software/reaction_509/reaction/tests/Internals.txt",
line 539, in Internals.txt
Failed example:
X.value = 2
Expected:
calculating B
calculating C
calculating A
calculating H
Got:
calculating B
calculating C
calculating H
calculating A


----------------------------------------------------------------------
Ran 325 tests in 1.959s
> ...
>
> read more »

Sergey Schetinin

unread,
Aug 27, 2010, 8:07:58 AM8/27/10
to better...@googlegroups.com
fixed in repo tip

> Unsubscribe: better-pytho...@googlegroups.com

--
Best Regards,
Sergey Schetinin

http://self.maluke.com/ -- My articles and open-source stuff
http://www.maluke.com/ -- My commercial software and custom development services

Reguillo

unread,
Sep 3, 2010, 4:59:41 AM9/3/10
to Better Python
Thanks for the fast fix.

On Aug 27, 2:07 pm, Sergey Schetinin <mal...@gmail.com> wrote:
> fixed in repo tip
>
> On 27 August 2010 14:29, Reguillo <reguil...@gmail.com> wrote:
>
> > This was related tohttp://groups.google.com/group/better-python/t/31ed23a6fefa68fe
> ...
>
> read more »
Reply all
Reply to author
Forward
0 new messages