[Zope-Coders] problem with Zope.App.startup
Chris McDonough
chrism at plope.com
Fri Feb 27 13:45:50 EST 2004
FWIW, I'm not sure this call to Zope.startup() is even necessary. When
its removed, 67 tests run (2 fail, which are the tests that you saw
failing). I think it's safe to remove this call.
On Fri, 2004-02-27 at 13:40, Chris McDonough wrote:
> You've found a way into the unit tests that dont set something up the
> right way. What "the right way" is, I'm not sure at the moment,
> however. Apparently there is no isolation between tests as far as the
> Zope configuration information goes, and some test that normally runs
> prior to this one sets things up for the ZPublisher tests. When it
> doesn't happen, the test suite chokes. I'm sure you probably already
> guessed as much, but that's about as much as I can tell you at the
> moment.
>
> - C
>
>
> On Fri, 2004-02-27 at 11:58, Jeremy Hylton wrote:
> > I'm having trouble running the tests this morning. I ran the tests
> > after a few changes to ZODB.DB.DB and saw a couple of apparently
> > unrelated failures in ZPublisher's xmlrpc tests. The tests were failing
> > because dumps() didn't take an allow_none argument, which was
> > surprising.
> >
> > I did a cvs update and tried to reproduce the failure. Now I can't even
> > get the tests to import:
> >
> > localhost:~/src/Zope> python test.py -bvv ZPub
> > /usr/local/bin/python setup.py build_ext -i
> > running build_ext
> > running build_ext
> > running build_ext
> > [14241 refs]
> > Running unit tests at level 1
> > Running unit tests from /home/jeremy/src/Zope
> > Traceback (most recent call last):
> > File "test.py", line 813, in ?
> > process_args()
> > File "test.py", line 803, in process_args
> > bad = main(module_filter, test_filter, libdir)
> > File "test.py", line 622, in main
> > runner(files, test_filter, debug)
> > File "test.py", line 542, in runner
> > s = get_suite(file)
> > File "test.py", line 450, in get_suite
> > mod = package_import(modname)
> > File "test.py", line 442, in package_import
> > mod = __import__(modname)
> > File
> > "/home/jeremy/src/Zope/lib/python/ZPublisher/tests/testBaseRequest.py",
> > line 4, in ?
> > Zope.startup()
> > File "/home/jeremy/src/Zope/lib/python/Zope/__init__.py", line 46, in
> > startup
> > _startup()
> > File "/home/jeremy/src/Zope/lib/python/Zope/App/startup.py", line 54,
> > in startup
> > DB = configuration.dbtab.getDatabase('/', is_root=1)
> > AttributeError: 'NoneType' object has no attribute 'getDatabase'
> >
> > I was worried that some of my recent changes to ZODB were to blame, but
> > I reverted them and still see the same problem.
> >
> > It looks like configuration is DefaultConfiguration, which defines dbtab
> > to be None. It looks like that's intentional, but then I can't figure
> > out how a call to Zope.startup() should work.
> >
> > Jeremy
> >
> >
> >
> > _______________________________________________
> > Zope-Coders mailing list
> > Zope-Coders at zope.org
> > http://mail.zope.org/mailman/listinfo/zope-coders
>
>
> _______________________________________________
> Zope-Coders mailing list
> Zope-Coders at zope.org
> http://mail.zope.org/mailman/listinfo/zope-coders
More information about the Zope-Coders
mailing list