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
anyio/3.3.0: failures running tests #368
Comments
This happens when you don't install the project before running tests. You should either use |
we do run tests from the install directory, if that wasnt the case we'd get a "no module named anyio" or something similar. this is a clear issue with how the parametrize decorator is used, or do you think otherwise? if so, please elaborate |
Here is a sample output from a pytest run:
The notable difference here is the lack of the Could you tell me the exact steps you are taking when installing anyio and running the tests? |
the lack of output is because it's still in the collecting phase, so pytest has not run any test, as you can see from:
I'm not at my workstation right now, so i'll post the steps later. The other differences i can see are:
|
I should point out that |
i'm afraid that wont fly for Debian: we dont use and likely (i;m not sure we ever discussed this) wont use pip to build packages.
can you explain how you came to this conclusion? the error is
which is factually correct: those functions do not use |
Then what do you plan to do with newer projects that are either based on flit or poetry or don't have a
The AnyIO pytest plugin hijacks the test call operation and only passes arguments to the test function that is has actually declared, here: https://github.com/agronholm/anyio/blob/master/src/anyio/pytest_plugin.py#L125-L127 Which version of setuptools are you using btw? That might yield useful clues. |
this is a bit orthogonal to this discussion, but in that case we're gonna use flit or poetry, or convert pyproject.toml to setup.py (which i already had to do a handful of time since poetry is not part of Debian yet), but again i dont think this matters here, since anyio still provides setup.py.
we have 52.0.0 for setuptools and 6.0.1 for setuptools-scm. I did more tests and here is what i get when i run
as expected, the module is not found and you get a nice ModuleNotFoundError. now if i set
so here the module is found and pytest complains that anyio is not registered in the config as a marker, now if i add pytest.ini
so it seems somehow only when using anyio_backend we have an issue, is there anything special about it? The way we are building this package is by running |
Again, the reason this is happening is because pytest cannot detect the AnyIO pytest plugin. The plugin is not detected via setuptools entrypoints since the project has not been installed. Adding the marker is pointless since the pytest plugin does that on its own which is why it's not present in The |
OMG yes, you're right, sorry i didnt register before what you meant with entry point. running egg_info helped and now the test suite runs. sadly there's still several errors ( thanks for your help so far! |
You can skip the network tests with the pytest switch |
so the network issues are due to the build env thinks it has IPv6 support while it actually does not, so i can easily disable that. What's left is this weird error in the
(i just reported the first set of tests) it looks like it's expecting a list, gets a string and so iterates on each character of that string; does that look familiar to you? |
I have never seen this error before. Can you report what Python gives as output when you do |
|
That function returns a hard coded tuple of backend names (here). Have you modified the source in a way that breaks the tests? |
you're right! we disabled the i think we're done here and all the problems i was seeing are gone -- thanks again for your help |
too soon :) we got another couple of errors:
do you think you can have a look at this too? thanks! |
This tuple is not a part of the API and thus was not designed to be altered. Furthermore, the return annotation of
What version of uvloop are you running? |
0.16.0 |
This does not look like it was caused by anyio, as anyio does not pass the |
Also, does this happen without uvloop ( |
This looks like asyncio itself is passing the deprecated |
i think it's pytest that interprets a warning as an error nowdays, setting
as |
I was just typing a message saying that relaxing the pytest warning filter would let the test suite pass :) |
I am still on Python 3.9.6 myself; you're running 3.9.7 which slightly alters the handling of async generators which may have triggered this error. |
Yup, I just installed 3.9.7 from source and I get the same test failures with that version. |
I should also point out that you should probably package v3.3.1 which I released a couple days ago. |
Another Debian developer took care of that, i think we're all set here -- thanks a lot for your help! |
Hello,
i'm packaging the latest version of anyio for Debian, and we are seeing some errors running tests
first we get this:
but adding a pytest.ini file with:
it goes a bit better but still fails with:
which is indeed correct, since those 2 functions dont use the
parametrize
parameter.any idea how to address the last issue? should you also add a pytest.ini to the repo? (i noticed there's a reference in pyproject.toml, but Debian doesnt use poetry yet, and even when copying those options, tests fail with a traceback in pytest)
thanks!
The text was updated successfully, but these errors were encountered: