Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directives scopes #458

Open
thedrow opened this issue Feb 19, 2017 · 1 comment
Open

Directives scopes #458

thedrow opened this issue Feb 19, 2017 · 1 comment

Comments

@thedrow
Copy link

thedrow commented Feb 19, 2017

py.test has a concept of scopes for fixtures which is being used to store data that is global and only needs to be loaded once per test module or once per testing session.
Similarly, we can use directives to store connections to databases and other global resources.
Since we don't want to create a new connection every time the directive is called we need some way to memoize the value of the directive for further use.
Can this be done with the current API? If not, what do we need to do in order to add this functionality?

@bernhardreiter
Copy link
Contributor

bernhardreiter commented Feb 20, 2017

Just to clarify, I'm assuming you are refering to http://pytest.org .

Note that your question to me seem to suggest how a technical solution for #376 could be implemented.
(In my simple hug solutions I'm using global variables, which has some drawbacks. I'll add a comment to #376 about this next.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants