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

Alternative for register #193

Open
youtux opened this issue Feb 28, 2023 · 0 comments
Open

Alternative for register #193

youtux opened this issue Feb 28, 2023 · 0 comments

Comments

@youtux
Copy link
Contributor

youtux commented Feb 28, 2023

We may want to provide an alternative to the register(...) function to inject fixtures in the current module.

I considered having a special variable, like "bdd_fixtures", that the user can declare in the module. We can then check at collection time if a module has this variable and inject the fixtures.

Example:

factoryboy_fixtures = (
    register("foo", FooFactory),
    ...
)

The reason for this is that it's not nice to have to do a from .my_fixtures import * for a user when fixtures are defined across multiple modules and have to be imported in the main conftest.py.

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

No branches or pull requests

1 participant