-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Tests cannot be run from the source tree #84
Comments
Huh, that's weird. I get the same thing. I've definitely been able to run the tests locally in the past. It might have been something like Our CI is still passing AFAIK. I'm pretty sure that what it's doing differently is actually installing pytest-trio before trying to test it. We do this to get a more realistic test (it makes sure that e.g. our setup.py isn't leaving out anything important), but it also means that we're generating pytest's plugin metadata. Having to install is annoying for local dev, so it would be nice to fix this, but I don't think this actually affects any users of pytest-trio. In particular, if you just want to use async fixtures in your own project, then I don't think you need to worry about this. |
Hmm, it looks like a workaround is to do:
I'm not a big fan of editable installs in general, because they involve creating static metadata that inevitably gets out of date with the actual source tree, but in this particular case I guess the risks aren't too bad and it does work. |
That works for me too. Thanks! |
I would like to have this fixed |
@Alessandro-Barbieri What trouble is it causing for you? Are you trying to make changes to pytest-trio? |
@njsmith I'm trying to package this for Gentoo. The pip workaround is unacceptable, I need another solution. The error I get is this https://gist.github.com/Alessandro-Barbieri/bb9b5fffa660637aac9c4e3a1fd3ff60 |
FWIW, I packaged this for myself locally, and overrode the tests to not test at all to work around this for now. |
(for Debian/Ubuntu, not Gentoo) |
@Alessandro-Barbieri If you know how to fix it then we would love to merge a patch, but I don't know how to fix it. Can you somehow install the package first before running the tests? |
@njsmith yes, I already installed the package |
@Alessandro-Barbieri If you have a python environment with pytest-trio installed, then you should be able to run the pytest-trio tests using |
with pytest-5.4.2 I get
|
@Alessandro-Barbieri just a note, I got tests working with |
I tried and now the tests run but with 33 failures, might open a new issue for that |
Seems similar to #103 (comment). Maybe the same thing will help? tl;dr: |
Thank you for pytest-trio! It looks like exactly what I'm looking for - in particular async fixtures. Unfortunately I haven't been able to get it to work at all in what I think should be the simplest and most obvious configuration.
On Debian or Ubuntu, I cannot find any configuration that allows the test to pass, following
CHEATSHEET.rst
as documented. My steps are as follows, having first installed onlypython3
,virtualenv
andgit
in a fresh container:This works neither on Debian buster nor on Debian sid. I have also tried various other combinations of things, including Ubuntu, but cannot find any combination that works.
I found issue #66 so I tried using some previous versions of pytest, but nothing works. Although the error changes, I can't seem to find any version of pytest to use in which the test suite doesn't indicate that the pytest hook works at all.
The most helpful error message I can find is against pytest 4.4.2, which seems to be full of things like:
Presumably this is something to do with pytest plugin integration?
The full test failure output against pytest 4.4.2 is attached.
test-failure.log
If you're doing something different that makes your tests pass, what is it please, and could you update
CHEATSHEET.rst
to match?The text was updated successfully, but these errors were encountered: