Re: [pylons-devel] Help with testing Pyramid app composition done with config.include()

2020-12-03 Thread Karl O. Pinc
On Thu, 3 Dec 2020 23:41:04 -0600 Michael Merickel wrote: > The request.registry = ... is fine and supported. The alternative is > that you can just do everything with the threadlocal pushed and then > DummyRequest will pick up the registry automatically. > > with config: > request =

Re: [pylons-devel] Help with testing Pyramid app composition done with config.include()

2020-12-03 Thread Michael Merickel
The request.registry = ... is fine and supported. The alternative is that you can just do everything with the threadlocal pushed and then DummyRequest will pick up the registry automatically. with config: request = DummyRequest() path = request.route_path(route_name) Or manually with

Re: [pylons-devel] Help with testing Pyramid app composition done with config.include()

2020-12-03 Thread Karl O. Pinc
Hi Micheal, Thanks very much for the prompt reply. My reply inline below. On Thu, 3 Dec 2020 22:16:15 -0600 Michael Merickel wrote: > Have you looked at querying data out of the introspector after > config.commit()? > > For example, the following will return the route descriptors >

Re: [pylons-devel] Help with testing Pyramid app composition done with config.include()

2020-12-03 Thread Michael Merickel
Have you looked at querying data out of the introspector after config.commit()? For example, the following will return the route descriptors registered for this name [1]: config.introspector.get('routes', route_name) You can also make a dummy request and use it to generate routes. For example:

[pylons-devel] Help with testing Pyramid app composition done with config.include()

2020-12-03 Thread Karl O. Pinc
Hi, I've a Pyramid app that's composed of multiple python distributions (packages). I'm writing integration tests for the code that calls Configurator() and then uses the resulting config to do config.include() on the various components. The application uses URL dispatch. Mostly, the