diff options
| author | Karen Dalton <kd@karend.net> | 2015-06-01 12:54:43 -0700 |
|---|---|---|
| committer | Karen Dalton <kd@karend.net> | 2015-06-01 12:54:43 -0700 |
| commit | 608f955e20723723f33750211bb12debf613819b (patch) | |
| tree | c0a39d3de0fee987887d97b1ac7dbe053317918e /docs/quick_tutorial/databases | |
| parent | a613f28670b8d5a63ad182507e3fb7634bb86560 (diff) | |
| download | pyramid-608f955e20723723f33750211bb12debf613819b.tar.gz pyramid-608f955e20723723f33750211bb12debf613819b.tar.bz2 pyramid-608f955e20723723f33750211bb12debf613819b.zip | |
Add additional logging configs necessary for db script output and update tests.py to fix the 'At least one scoped session' warning
Diffstat (limited to 'docs/quick_tutorial/databases')
| -rw-r--r-- | docs/quick_tutorial/databases/development.ini | 36 | ||||
| -rw-r--r-- | docs/quick_tutorial/databases/tutorial/tests.py | 4 |
2 files changed, 38 insertions, 2 deletions
diff --git a/docs/quick_tutorial/databases/development.ini b/docs/quick_tutorial/databases/development.ini index 04c249a62..5da87d602 100644 --- a/docs/quick_tutorial/databases/development.ini +++ b/docs/quick_tutorial/databases/development.ini @@ -11,3 +11,39 @@ sqlalchemy.url = sqlite:///%(here)s/sqltutorial.sqlite use = egg:pyramid#wsgiref host = 0.0.0.0 port = 6543 + +# Begin logging configuration + +[loggers] +keys = root, tutorial, sqlalchemy.engine.base.Engine + +[logger_tutorial] +level = DEBUG +handlers = +qualname = tutorial + +[handlers] +keys = console + +[formatters] +keys = generic + +[logger_root] +level = INFO +handlers = console + +[logger_sqlalchemy.engine.base.Engine] +level = INFO +handlers = +qualname = sqlalchemy.engine.base.Engine + +[handler_console] +class = StreamHandler +args = (sys.stderr,) +level = NOTSET +formatter = generic + +[formatter_generic] +format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s + +# End logging configuration diff --git a/docs/quick_tutorial/databases/tutorial/tests.py b/docs/quick_tutorial/databases/tutorial/tests.py index e18e70c8c..1e08ef760 100644 --- a/docs/quick_tutorial/databases/tutorial/tests.py +++ b/docs/quick_tutorial/databases/tutorial/tests.py @@ -40,7 +40,6 @@ class WikiViewTests(unittest.TestCase): class WikiFunctionalTests(unittest.TestCase): def setUp(self): - self.session = _initTestingDB() self.config = testing.setUp() from pyramid.paster import get_app app = get_app('development.ini') @@ -48,7 +47,8 @@ class WikiFunctionalTests(unittest.TestCase): self.testapp = TestApp(app) def tearDown(self): - self.session.remove() + from .models import DBSession + DBSession.remove() testing.tearDown() def test_it(self): |
