Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2166 (closed defect: invalid)

Opened 10 years ago

Last modified 10 years ago

quickstart-generated tests crash

Reported by: pitrou Owned by: Gustavo
Priority: normal Milestone: 2.0b5
Component: TurboGears Version:
Severity: normal Keywords: repoze.what.plugins.sql
Cc:

Description

After downloading 2.0b4, I quickstarted a project and tried running the generated tests with nose, and got the following traceback:

Traceback (most recent call last):

File "/usr/bin/nosetests", line 8, in <module>

load_entry_point('nose==0.10.4', 'console_scripts', 'nosetests')()

File "/usr/lib/python2.5/site-packages/nose-0.10.4-py2.5.egg/nose/core.py", line 219, in init

argv=argv, testRunner=testRunner, testLoader=testLoader)

File "/usr/lib64/python2.5/unittest.py", line 767, in init

self.parseArgs(argv)

File "/usr/lib/python2.5/site-packages/nose-0.10.4-py2.5.egg/nose/core.py", line 236, in parseArgs

self.config.configure(argv, doc=TestProgram?.doc)

File "/usr/lib/python2.5/site-packages/nose-0.10.4-py2.5.egg/nose/config.py", line 295, in configure

self.plugins.begin()

File "/usr/lib/python2.5/site-packages/nose-0.10.4-py2.5.egg/nose/plugins/manager.py", line 81, in call

return self.call(*arg, kw)

File "/usr/lib/python2.5/site-packages/nose-0.10.4-py2.5.egg/nose/plugins/manager.py", line 145, in simple

result = meth(*arg, kw)

File "/usr/lib/python2.5/site-packages/Pylons-0.9.7rc4-py2.5.egg/pylons/test.py", line 72, in begin

self.app = pylonsapp = loadapp('config:' + self.config_file, relative_to=path)

File "/usr/lib/python2.5/site-packages/PasteDeploy-1.3.2-py2.5.egg/paste/deploy/loadwsgi.py", line 204, in loadapp

return loadobj(APP, uri, name=name, kw)

File "/usr/lib/python2.5/site-packages/PasteDeploy-1.3.2-py2.5.egg/paste/deploy/loadwsgi.py", line 225, in loadobj

return context.create()

File "/usr/lib/python2.5/site-packages/PasteDeploy-1.3.2-py2.5.egg/paste/deploy/loadwsgi.py", line 625, in create

return self.object_type.invoke(self)

File "/usr/lib/python2.5/site-packages/PasteDeploy-1.3.2-py2.5.egg/paste/deploy/loadwsgi.py", line 110, in invoke

return fix_call(context.object, context.global_conf, context.local_conf)

File "/usr/lib/python2.5/site-packages/PasteDeploy-1.3.2-py2.5.egg/paste/deploy/util/fixtypeerror.py", line 57, in fix_call

val = callable(*args, kw)

File "/home/antoine/ftth/pyftth/ftth/config/middleware.py", line 10, in make_app

app = make_base_app(global_conf, full_stack=True, app_conf)

File "/usr/lib/python2.5/site-packages/TurboGears2-2.0b4-py2.5.egg/tg/configuration.py", line 591, in make_base_app

app = self.add_auth_middleware(app)

File "/usr/lib/python2.5/site-packages/TurboGears2-2.0b4-py2.5.egg/tg/configuration.py", line 478, in add_auth_middleware

app = setup_sql_auth(app, auth_args)

TypeError?: setup_sql_auth() takes at least 5 non-keyword arguments (4 given); got ({'error_...ue'}, beaker.session.key=..., beaker.session.secret=..., cache_dir=..., full_stack=..., sqlalchemy.echo=..., sqlalchemy.echo_pool=..., sqlalchemy.pool_recycle=..., sqlalchemy.url=...), wanted (global_conf, full_stack=True, app_conf)

Change History

comment:1 follow-up: ↓ 3 Changed 10 years ago by Gustavo

  • Status changed from new to assigned
  • Owner changed from faide to Gustavo

I can't reproduce it. For some (weird) reason, you seem to be using an old version of repoze.what.plugins.sql. Can you please try:

easy_install -U repoze.what.plugins.sql

Cheers.

comment:2 Changed 10 years ago by Gustavo

  • Keywords repoze.what.plugins.sql added

comment:3 in reply to: ↑ 1 Changed 10 years ago by pitrou

Replying to Gustavo:

I can't reproduce it. For some (weird) reason, you seem to be using an old version of repoze.what.plugins.sql. Can you please try:

easy_install -U repoze.what.plugins.sql

Thanks, unfortunately it doesn't change anything.

Under the Python prompt I get:

import repoze.what.plugins.sql repoze.what.plugins.sql.file

'/usr/lib/python2.5/site-packages/repoze.what.plugins.sql-1.0b1-py2.5.egg/repoze/what/plugins/sql/init.pyc'

Is it the latest version? (there doesn't seem to be a version attribute)

comment:4 Changed 10 years ago by pitrou

Sorry, the prompt transcription should read:

>>> import repoze.what.plugins.sql
>>> repoze.what.plugins.sql.__file__
'/usr/lib/python2.5/site-packages/repoze.what.plugins.sql-1.0b1-py2.5.egg/repoze/what/plugins/sql/__init__.pyc'

comment:5 Changed 10 years ago by Gustavo

Hi, pitrou.

This is really strange. I've installed TG 2.0b4 on a fresh virtualenv and I've had no problem while running the test suite for the just quickstarted application:

.....
----------------------------------------------------------------------
Ran 5 tests in 0.612s

OK

May I see the contents of {your-application}.config.app_cfg, please?

Cheers.

comment:6 Changed 10 years ago by pitrou

Here it is:

from tg.configuration import AppConfig, Bunch
import ftth
from ftth import model
from ftth.lib import app_globals, helpers

base_config = AppConfig()
base_config.renderers = []

base_config.package = ftth

#Set the default renderer
base_config.default_renderer = 'mako'
base_config.renderers.append('mako') 
base_config.renderers.append('genshi') 
# if you want raw speed and have installed chameleon.genshi
# you should try to use this renderer instead.
# warning: for the moment chameleon does not handle i18n translations
#base_config.renderers.append('chameleon_genshi') 

#Configure the base SQLALchemy Setup
base_config.use_sqlalchemy = True
base_config.model = ftth.model
base_config.db_session = ftth.model.db_session

# Configure the authentication backend
base_config.auth_backend = 'sqlalchemy'
base_config.sa_auth.db_session = model.db_session
# what is the class you want to use to search for users in the database
base_config.sa_auth.user_class = model.User
# what is the class you want to use to search for groups in the database
base_config.sa_auth.group_class = model.Group
# what is the class you want to use to search for permissions in the database
base_config.sa_auth.permission_class = model.Permission

# set a default hashing mechanism for the auth system
# this makes sure the passwords are not stored in clear-text
# inside the database. Choices are "md5", "sha1" or "salted_sha1"
base_config.sa_auth.password_encryption_method = "salted_sha1"

# override this if you would like to provide a different who plugin for 
# managing login and logout of your application
base_config.sa_auth.form_plugin = None

comment:7 Changed 10 years ago by pitrou

It should be noted that the functional tests are responsible for the failure. If I disable all the code in functional/test_root.py, the remaining tests run fine.

comment:8 Changed 10 years ago by pitrou

  • Status changed from assigned to closed
  • Resolution set to invalid

Got it: I had mistakingly renamed base_config.sa_auth.dbsession to base_config.sa_auth.db_session in config/app_cfg.py... Sorry for the noise.

Note: See TracTickets for help on using tickets.