-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Parse args from file #12085
Parse args from file #12085
Conversation
459f778
to
8f021a2
Compare
I don't understand why the test fails on py310 and py311. It seems to do it only when running with |
It's a Python bug python/cpython#85308 that it seems was only fixed in Python 3.12. So we should ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Can you also add a test using pytester
to testing/acceptance_test.py
? This will make sure it works end-to-end.
Sure! |
There is no reason to warn about it, I think it's a good thing.
…On Thu, Mar 7, 2024, at 21:38, Levon Saldamli wrote:
***@***.**** commented on this pull request.
In changelog/11871.feature.rst <#12085 (comment)>:
> +Added support for reading ``file_or_dir`` positional arguments from a file
+using the prefix character '@', like e.g.:
+
+``pytest @tests.txt``
You're right, it is not only positional arguments. `-k foo` in the file is treated as a `-k`-argument. Is this ok, as long as I update the changelog and warn about it? Not sure if and how it would be possible to avoid it.
—
Reply to this email directly, view it on GitHub <#12085 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAJKW7UTZYQFEYDN7KBVEC3YXC635AVCNFSM6AAAAABEJ6MDI6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTSMRTGM3TAOJRGE>.
You are receiving this because you commented.Message ID: ***@***.***>
|
24675ae
to
bc68ed1
Compare
Acceptance test added. |
bc68ed1
to
4e530e1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few small comments, but with them I think this is good to go.
Co-authored-by: Ran Benita <[email protected]>
Co-authored-by: Ran Benita <[email protected]>
56bac60
to
a413282
Compare
Thanks! Updated now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, thanks!
We should add this feature to the docs, I think here is a good place to mention it:
https://docs.pytest.org/en/stable/how-to/usage.html#specifying-which-tests-to-run
I made an attempt, please check if it works :) |
5a98980
to
f66dbf5
Compare
f66dbf5
to
1cf0413
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Co-authored-by: Ran Benita <[email protected]> Co-authored-by: Bruno Oliveira <[email protected]>
That's a very nice feature - can it also read in parameterized tests though such as: from a file? It doesn't seem to find them |
@patrickvonplaten The tests added in this PR test exactly that. I suggest you open a new issue with more information and a reproducer. |
Actually everything works just fine - sorry for the noise |
Fixes #11871 using the proposed solution in #11871 (comment)
Adds support for reading
file_or_dir
positional arguments from a fileusing the prefix character '@', like e.g.:
pytest @tests.txt
Added tests, but not sure how/where to add documentation, I'm guessing it should be in the output of
pytest --help
?