Ticket #1630 (closed enhancement: fixed)

Opened 2 years ago

Last modified 2 years ago

Warning about logger in unittests of freshstarted project with identity

Reported by: chrisz Assigned to: anonymous
Priority: low Milestone: 1.0.4
Component: TurboGears Version: 1.0.4b3
Severity: minor Keywords:
Cc:

Description

When I run the unit tests for a fresh project created with

tg-admin quickstart -i foo

I get the following warning in the output:

No handlers could be found for logger "turbogears.identity.soprovider"

This is not an error, just not nice and maybe irritating for new users.

Attachments

logging_problem.patch (1.8 kB) - added by chrisz on 12/16/07 11:50:11.
Patch against 1.0 branch

Change History

12/16/07 11:50:11 changed by chrisz

  • attachment logging_problem.patch added.

Patch against 1.0 branch

12/16/07 11:52:20 changed by chrisz

The problem is that testutil reads only test.cfg and app.cfg, but neither dev.cfg nor log.cfg. So I have added the log config to test.cfg. I have also configured a logger for turbogears.identity in dev.cfg.

12/16/07 12:07:02 changed by Chris Arndt

Though I didn't get the error (with TG from SVN) in the first place, the patch is sensible, works for me and doesn't break anything.

+1 on submitting it.

12/16/07 12:17:24 changed by chrisz

Did you create a fresh project with "-i"? You can see the same warning in #1216.

12/16/07 12:36:11 changed by Chris Arndt

Yes, I created a project witg TG revision r3827 and the command tg-admin quickstart -i -p itest ITest

Then I did

# cd ITest
# python setup.py test

and the output was

running test
running egg_info
writing requirements to ITest.egg-info/requires.txt
writing ITest.egg-info/PKG-INFO
writing top-level names to ITest.egg-info/top_level.txt
writing dependency_links to ITest.egg-info/dependency_links.txt
writing entry points to ITest.egg-info/entry_points.txt
reading manifest file 'ITest.egg-info/SOURCES.txt'
writing manifest file 'ITest.egg-info/SOURCES.txt'
running build_ext
collector in ['/home/chris/tmp/build/ITest'] ... test module itest in /home/chris/tmp/build/ITest ... test directory /home/chris/tmp/build/ITest/itest in itest ... test module itest.config in /home/chris/tmp/build/ITest ... test directory /home/chris/tmp/build/ITest/itest/config in itest.config ... test module itest.templates in /home/chris/tmp/build/ITest ... test directory /home/chris/tmp/build/ITest/itest/templates in itest.templates ... test module itest.tests in /home/chris/tmp/build/ITest ... test directory /home/chris/tmp/build/ITest/itest/tests in itest.tests ... test module itest.tests.test_controllers in /home/chris/tmp/build/ITest ... test class <class 'itest.tests.test_controllers.TestPages'> ... The indexpage should have the right title ... ok
login page should have the right title ... ok
the index method should return a string called now ... ok
test module itest.tests.test_model in /home/chris/tmp/build/ITest ... 
----------------------------------------------------------------------
Ran 15 tests in 1.433s

OK

After applying your patch and creating a new project (I checked that the config files had the changes), I got the same output.

12/16/07 12:48:49 changed by chrisz

Ok, now I understand. In my TG installation I had already applied patch #1628 which adds another identity test to test_controllers.py. The standard tests in test_controllers.py do not reveal the problem because they don't produce any log output. But as soon as you do something more complicated and log output is created, then you'll get this warning.

12/16/07 13:39:18 changed by Chris Arndt

Chris, when you check this in, be sure to add short explanation to the upgrade instructions at http://docs.turbogears.org/1.0/RoughDocs/Upgrade on how to add the new logging configuration to old projects. Thx!

12/16/07 14:30:07 changed by chrisz

  • status changed from new to closed.
  • resolution set to fixed.

Done.

12/16/07 16:24:33 changed by Chris Arndt

Fixed in r3830.