>Thanks Cesar, but that's definitely not the answer. My 'fresh install'
>is working in all respects -- nosetest itself appears to work, but
>using the --with-doctest flag gives me an error...
I never used doctests, but the error is pretty clear: you try using a
controller's method without being in an actual request context. I don't know if
that's solvable in doc-tests, but you don't have any such issues if you use
'normal' tests that properly set up & configure a TG-app. Then you can use e.g.
app.get('/login'). Directly calling the controller is problematic I guess.
Diez
>
>
>
>On 31 Dec 2010, at 17:57, "César Fernández"
><[email protected]> wrote:
>
>> In a freshly installation of TG21, a first nosetest invocation failed
>> with something related to genshi stuff, but the error showed me a
>> message containing the word 'genshi' in the output.
>>
>> Anyway i resolved that simply installing genshi -> 'easy_install
>> genshi', i hope that it can be useful to you.
>>
>> 2010/12/31 Robert Sudwarts <[email protected]>:
>>> Hi,
>>> I've just installed the latest TG2 version (using easy_install -i
>>> http://www.turbogears.org/2.1/downloads/current/index tg.devtools)
>>> I'm trying to use nosetests (and particularly nosetests --with-
>>> doctest) on a
>>> freshly installed application. Nosetest (on it's own) seems to run
>>> ok but
>>> with a warning given for an SQLAlchemy unicode parameter, but --
>>> with-doctest
>>> seems to be picking up a genuine error/possibly bug:
>>> ERROR: Failure: TypeError (No object (name: request) has been
>>> registered for
>>> this thread)
>>> (and I have no clue where to start.)
>>> I have included the traceback for both 'nosetests -v' and
>>> 'nosetests -v
>>> --with-doctest' below and would be really grateful for any
>>> assistance.
>>> Thanks in advance,
>>> Rob
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---------------------------------------------------------------------
>>> A: (tg21env) $ nosetests -v
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---------------------------------------------------------------------
>>> Anonymous users are forced to login ... ok
>>> Logouts must work correctly ... ok
>>> Voluntary logins must work correctly ... ok
>>> The data display demo works with HTML ... ok
>>> The data display demo works with JSON ... ok
>>> Displaying the wsgi environ works ... ok
>>> The front page is working properly ... ok
>>> Anonymous users must not access the secure controller ... ok
>>> The editor cannot access the secure controller ...
>>> /home/robertsudwarts/tg21env/lib/python2.6/site-packages/
>>> SQLAlchemy-0.6.5-py2.6.egg/sqlalchemy/engine/default.py:506:
>>> SAWarning: Unicode type received non-unicode bind param value.
>>> param.append(processors[key](compiled_params[key]))
>>> ok
>>> The manager can access the secure controller ... ok
>>> Model objects can be created ... ok
>>> Model objects can be queried ... ok
>>> Model objects can be created ... ok
>>> Model objects can be queried ... ok
>>> Model objects can be created ... ok
>>> Users should be fetcheable by their email addresses ... ok
>>> User objects should have no permission by default. ... ok
>>> The obj constructor must set the email right ... ok
>>> The obj constructor must set the user name right ... ok
>>> Model objects can be queried ... ok
>>> ---
>>> -------------------------------------------------------------------
>>> Ran 20 tests in 1.507s
>>> OK
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---------------------------------------------------------------------
>>> B: (tg21env)$ nosetests -v --with-doctest
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---
>>> ---------------------------------------------------------------------
>>> Failure: TypeError (No object (name: request) has been registered
>>> for this
>>> thread) ... ERROR
>>> Anonymous users are forced to login ... ok
>>> Logouts must work correctly ... ok
>>> Voluntary logins must work correctly ... ok
>>> The data display demo works with HTML ... ok
>>> The data display demo works with JSON ... ok
>>> Displaying the wsgi environ works ... ok
>>> The front page is working properly ... ok
>>> Anonymous users must not access the secure controller ... ok
>>> The editor cannot access the secure controller ...
>>> /home/robertsudwarts/tg21env/lib/python2.6/site-packages/
>>> SQLAlchemy-0.6.5-py2.6.egg/sqlalchemy/engine/default.py:506:
>>> SAWarning: Unicode type received non-unicode bind param value.
>>> param.append(processors[key](compiled_params[key]))
>>> ok
>>> The manager can access the secure controller ... ok
>>> Model objects can be created ... ok
>>> Model objects can be queried ... ok
>>> Model objects can be created ... ok
>>> Model objects can be queried ... ok
>>> Model objects can be created ... ok
>>> Users should be fetcheable by their email addresses ... ok
>>> User objects should have no permission by default. ... ok
>>> The obj constructor must set the email right ... ok
>>> The obj constructor must set the user name right ... ok
>>> Model objects can be queried ... ok
>>> ===
>>> ===================================================================
>>> ERROR: Failure: TypeError (No object (name: request) has been
>>> registered for
>>> this thread)
>>> ---
>>> -------------------------------------------------------------------
>>> Traceback (most recent call last):
>>> File
>>> "/home/robertsudwarts/tg21env/lib/python2.6/site-packages/
>>> nose-0.11.4-py2.6.egg/nose/loader.py",
>>> line 382, in loadTestsFromName
>>> addr.filename, addr.module)
>>> File
>>> "/home/robertsudwarts/tg21env/lib/python2.6/site-packages/
>>> nose-0.11.4-py2.6.egg/nose/importer.py",
>>> line 39, in importFromPath
>>> return self.importFromDir(dir_path, fqname)
>>> File
>>> "/home/robertsudwarts/tg21env/lib/python2.6/site-packages/
>>> nose-0.11.4-py2.6.egg/nose/importer.py",
>>> line 86, in importFromDir
>>> mod = load_module(part_fqname, fh, filename, desc)
>>> File "/home/robertsudwarts/tg21env/src/nosey/nosey/controllers/
>>> root.py",
>>> line 20, in <module>
>>> class RootController(BaseController):
>>> File "/home/robertsudwarts/tg21env/src/nosey/nosey/controllers/
>>> root.py",
>>> line 79, in RootController
>>> def login(self, came_from=url('/')):
>>> File
>>> "/home/robertsudwarts/tg21env/lib/python2.6/site-packages/
>>> TurboGears2-2.1-py2.6.egg/tg/controllers/util.py",
>>> line 90, in url
>>> base_url = pylons.request.environ['SCRIPT_NAME'] + base_url
>>> File
>>> "/home/robertsudwarts/tg21env/lib/python2.6/site-packages/
>>> Paste-1.7.2-py2.6.egg/paste/registry.py",
>>> line 137, in __getattr__
>>> return getattr(self._current_obj(), attr)
>>> File
>>> "/home/robertsudwarts/tg21env/lib/python2.6/site-packages/
>>> Paste-1.7.2-py2.6.egg/paste/registry.py",
>>> line 194, in _current_obj
>>> 'thread' % self.____name__)
>>> TypeError: No object (name: request) has been registered for this
>>> thread
>>> -------------------- >> begin captured logging <<
>>> --------------------
>>> pylons.configuration: DEBUG: Initializing configuration, package:
>>> 'nosey'
>>> routes.middleware: DEBUG: Initialized with method overriding =
>>> True, and
>>> path info altering = True
>>> tw.core.resources: DEBUG: Registered static at /tw.forms/static
>>> tw.core.resources: DEBUG: Registered static/calendar at
>>> /tw.forms/static/calendar
>>> --------------------- >> end captured logging <<
>>> ---------------------
>>> ---
>>> -------------------------------------------------------------------
>>> Ran 21 tests in 1.545s
>>> FAILED (errors=1)
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups
>>> "TurboGears" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected].
>>> For more options, visit this group at
>>> http://groups.google.com/group/turbogears?hl=en.
>>>
>>
>>
>>
>> --
>> There's no religion but sex and music
>> -- Sting
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "TurboGears" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/turbogears?hl=en
>> .
>>
>
>--
>You received this message because you are subscribed to the Google Groups
>"TurboGears" group.
>To post to this group, send email to [email protected].
>To unsubscribe from this group, send email to
>[email protected].
>For more options, visit this group at
>http://groups.google.com/group/turbogears?hl=en.
>
___________________________________________________________
Empfehlen Sie WEB.DE DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.web.de
--
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en.