[py-dev] Resource providers

holger krekel holger at merlinux.eu
Mon Jun 25 15:29:36 CEST 2012


Hi Floris,

On Mon, Jun 25, 2012 at 10:55 +0100, Floris Bruynooghe wrote:
> Hi Holger, everyone,
> 
> Yesterday a resource provider API was considered on IRC, unfortunately
> I have no logs and forgot the details already.  But today I remembered
> a, possibly invalid, use case which might want to benefit form this:
> occasionally I wish it was possible to dynamically create funcarg
> objects.
> 
> The concrete example I have now is that it could be nice in
> pytest-django to be able to request e.g. "Users" which is a model
> class used to access the User table in the database.  Currently this
> is only possible by someone explicitly defining pytest_funcarg__Users,
> but Django allows you to dynamically look up all the models in the
> database so there is no reason this can't be build automatically.
> 
> I think this is what the API you proposed was for, but as I said I
> can't remember the details.  And in this case I might be less
> enthusiastic in postponing it's implementation to a later release ;-)

It's probably true that we could invent an register-factory API for this.

However, what about a single "models" object (done traditionally
with a pytest_funcarg__models definition) which itself provides
an API to give "Users" or others data?

best,
holger

> Regards,
> Floris
> 
> -- 
> Debian GNU/Linux -- The Power of Freedom
> www.debian.org | www.gnu.org | www.kernel.org
> _______________________________________________
> py-dev mailing list
> py-dev at codespeak.net
> http://codespeak.net/mailman/listinfo/py-dev
> 



More information about the Pytest-dev mailing list