Skip to content
Browse files

Merge pull request #205 from ppaez/master

Fix "[Error 32] file being used by another process" in ZODB tutorial functional tests
  • Loading branch information...
2 parents aee35e3 + e3d556f commit 703e3677dc42518cb80626650aaf62e7db17812a @mcdonc mcdonc committed Jun 6, 2011
View
4 docs/tutorials/wiki/src/authorization/tutorial/__init__.py
@@ -16,8 +16,8 @@ def main(global_config, **settings):
authn_policy = AuthTktAuthenticationPolicy(secret='sosecret',
callback=groupfinder)
authz_policy = ACLAuthorizationPolicy()
- zodb_uri = settings.get('zodb_uri')
- if zodb_uri is None:
+ zodb_uri = settings.get('zodb_uri', False)
+ if zodb_uri is False:
raise ValueError("No 'zodb_uri' in application configuration.")
finder = PersistentApplicationFinder(zodb_uri, appmaker)
View
4 docs/tutorials/wiki/src/basiclayout/tutorial/__init__.py
@@ -5,8 +5,8 @@
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
- zodb_uri = settings.get('zodb_uri')
- if zodb_uri is None:
+ zodb_uri = settings.get('zodb_uri', False)
+ if zodb_uri is False:
raise ValueError("No 'zodb_uri' in application configuration.")
finder = PersistentApplicationFinder(zodb_uri, appmaker)
View
4 docs/tutorials/wiki/src/models/tutorial/__init__.py
@@ -5,8 +5,8 @@
def main(global_config, **settings):
""" This function returns a WSGI application.
"""
- zodb_uri = settings.get('zodb_uri')
- if zodb_uri is None:
+ zodb_uri = settings.get('zodb_uri', False)
+ if zodb_uri is False:
raise ValueError("No 'zodb_uri' in application configuration.")
finder = PersistentApplicationFinder(zodb_uri, appmaker)
View
10 docs/tutorials/wiki/src/tests/tutorial/tests.py
@@ -139,16 +139,20 @@ def setUp(self):
self.tmpdir = tempfile.mkdtemp()
dbpath = os.path.join( self.tmpdir, 'test.db')
- settings = { 'zodb_uri' : 'file://' + dbpath }
+ from repoze.zodbconn.uri import db_from_uri
+ db = db_from_uri('file://' + dbpath)
+ settings = { 'zodb_uri' : None }
app = main({}, **settings)
- from repoze.zodbconn.middleware import EnvironmentDeleterMiddleware
- app = EnvironmentDeleterMiddleware(app)
+ from repoze.zodbconn.connector import Connector
+ app = Connector(app, db)
+ self.db = db
from webtest import TestApp
self.testapp = TestApp(app)
def tearDown(self):
import shutil
+ self.db.close()
shutil.rmtree( self.tmpdir )
def test_root(self):
View
4 docs/tutorials/wiki/src/views/tutorial/__init__.py
@@ -5,8 +5,8 @@
def main(global_config, **settings):
""" This function returns a WSGI application.
"""
- zodb_uri = settings.get('zodb_uri')
- if zodb_uri is None:
+ zodb_uri = settings.get('zodb_uri', False)
+ if zodb_uri is False:
raise ValueError("No 'zodb_uri' in application configuration.")
finder = PersistentApplicationFinder(zodb_uri, appmaker)
View
2 docs/tutorials/wiki/tests.rst
@@ -73,6 +73,6 @@ The expected result looks something like:
.........
----------------------------------------------------------------------
- Ran 9 tests in 0.203s
+ Ran 23 tests in 1.653s
OK
View
4 pyramid/scaffolds/zodb/+package+/__init__.py_tmpl
@@ -5,8 +5,8 @@ from {{package}}.models import appmaker
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
- zodb_uri = settings.get('zodb_uri')
- if zodb_uri is None:
+ zodb_uri = settings.get('zodb_uri', False)
+ if zodb_uri is False:
raise ValueError("No 'zodb_uri' in application configuration.")
finder = PersistentApplicationFinder(zodb_uri, appmaker)

0 comments on commit 703e367

Please sign in to comment.
Something went wrong with that request. Please try again.