-
Notifications
You must be signed in to change notification settings - Fork 371
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
Expose pytest integration as a plugin #1526
Comments
Sounds cool. I'd lean toward option 1 because otherwise we'd create a lot of organization and boilerplate (a GitHub repo, a PyPI package, etc.) for a one-liner. Users will already have to add "hy.contrib.pytest_plugin" to their I would name it |
We can start with option 1 and move to option 2 if it ever becomes a problem with it being a default. |
Hi! |
Cool, thanks. Perhaps we'll do that. |
At this point, you can get pytest working with Hy with about 5 lines of configuration, so I've documented them on the wiki, and a plugin seems like overkill. |
So, was going to put this off until I got some of my other ideas completed, but someone just opened an issue on an old project I started the last time I was playing with Hy: vodik/hytest#1
That project was me fiddling with writing a pytest plugin that integrated Hy into pytest.
But we already do this. So, my proposal is to do the following:
conftest.py
and move it somewhere inside thehy
package (sayhy.contrib.pytest_plugin
)conftest.py
to usepytest_plugins = ['hy.contrib.pytest_plugin']
Now we have two options for exposing this to the general pytest community:
pytest-hy
that registers a pytest plugin which contains a single line along the lines of:I'm more in favour of the later, as its more explicit. It is also how I've seen other libraries do it, for example pytest-aiohttp
We could also promote a few useful functions like
can_compile
,can_eval
, etc as pytest fixtures for other projects to reuse.The text was updated successfully, but these errors were encountered: