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

Feature request - package pytest fixtures for downstream libs #753

Open
dazza-codes opened this issue Feb 9, 2020 · 2 comments · May be fixed by #766
Open

Feature request - package pytest fixtures for downstream libs #753

dazza-codes opened this issue Feb 9, 2020 · 2 comments · May be fixed by #766

Comments

@dazza-codes
Copy link
Contributor

dazza-codes commented Feb 9, 2020

Would it be possible to add a development option to the package so that it can provide pytest fixtures to downstream projects? Something like aiobotocore[dev] might provide pytest fixture methods? (It might introduce additional namespace requirements on the test suite.)

For example, dask provides test utilities in the package, see

Maybe this is out-of-scope in this project or it means a spin-off for something like a new "aiomoto" project.

PS, this is not a bug report - the issue creation options did not include a "feature request"

Related issues: #583 and #665

@thehesiod
Copy link
Collaborator

what in particular pytest packages would you like aioboto to provide? Seems like this is more of a aiomoto kind of thing.

@dazza-codes
Copy link
Contributor Author

dazza-codes commented Feb 16, 2020

In the short term, it might help if this project could expose a package-extra that might somehow bundle the pytest fixtures that manage the moto server (the tests/conftest.py module and the associated moto_server.py). Using moto defaults, it hooks into the before-call event and short-circuits all the aiobotocore request/response processing, but the test suite in this project disables that default moto behavior (details are noted in #755). Another option is to figure out a PR on moto that might provide some kind of aio option for the moto.settings.

# setup.py
setup(
    # the following makes a plugin available to pytest
    entry_points = {
        'pytest11': [
            'aiomoto = tests.conftest.py',  # or something
        ]
    },
    classifiers=["Framework :: Pytest"],
)

Providing the pytest-fixtures as a package extra would allow the fixtures to remain in this project so they continue to evolve along with this project, to be sure they work as required. If they are split out into a new aiomoto project, it could take on an independent life unless this project starts to depend on it as a pytest plugin. In the long term, an aiomoto project might replace flask with sanic for the server (but that might not really help things a whole lot).

@dazza-codes dazza-codes linked a pull request Feb 19, 2020 that will close this issue
@helpr helpr bot added the pr-available label Feb 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants