-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
collection: python_files=* / explicit collection #4476
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
Comments
im -1 on that one - if its not having a .py extension i don't want to see it collected as python module in core |
Fair point. What about a warning then if |
that sounds usefull |
sidenote - https://unix.stackexchange.com/questions/482459/specifying-the-file-extension-produced-by-zsh-process-substitution should set the temporary file thing right at least in part - it may need extra variables to make it pytohn-safe |
this doesn't help for my use case which is a small script that I don't want to have to ship as an entire package (see also #3520) |
why was this closed? is this abandoned, or fixed? thanks! |
@anarcat a new issue / PR should be created based on #4476 (comment) probably. Please do so if you want to "own" / work on it. |
Seriously? I'm with @anarcat on this one, mainly to satisfy packaging QA tools that yell at you for shipping a "binary" with a .py extension. If i do that ^^ pytest not only doesn't find the file but refuses to even touch it. Is the answer really "tell the package QA tool to blow" and always keep the .py extension if you want pytest to check it? In this case it's not a "trivial"/small script but an actual daemon script. |
IIUC the proposal here is for Lines 173 to 182 in 8be9684
All it would need is to remove the initial check for |
I agree with @nicoddemus here, re-opening for now. (@nicoddemus |
at first glance we would have to reconfigure both the python import system and the assertion rewriter to do it correctly, if that's the complexity needed, then i don't want to see it in core a plugin will have to contain it |
Agreed, if it is more complex than a first glance shows, then we should avoid adding it to the core. But if a simple implementation can be shown to support it, I would be OK with adding it to the core. |
The assert rewriting uses A simple implementation to show support for it would probably overwrite the |
I think it would be nice if
pytest =(echo "def test_foo: pass")
would work, i.e. it should consider any explicitly passed in file arguments for collection. (Zsh creates a temporary file here).Also using
-o 'python_files=*'
does not appear to help here.Related/via #4452.
The text was updated successfully, but these errors were encountered: