Skip to content

Alternative for register #193

@youtux

Description

@youtux

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions