-
-
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
Rewrite fails when first expression of file is a number and mistaken as docstring #11140
Comments
more details are needed - based on the exception, the docstring is a integer, that seems completely wrong |
I run it pass lasttime in 2023-6-20 17:07:23. it run in docker and install newest pytest before run testcase everytime . maybe some commit cause it recently.
|
thanks for the update i took the liberty to edit your comments to use markdown code blocks for ease of reading from the given information the problem is still unclear please try running with the error indicates that the python ast parser somehow ends up with a integer as the docstring for |
I run with --assert=plain and it has passed python3 -m pytest -k helloworld --assert=plain
|
It seems to me that we have a potential bug in the ast transformer where's in case the first expression of a file is a integer, we mistake it as a docstring Can you verify the first expression in the file that fails? |
you are right this file first expression is a 0 . It can pass after I delete it |
Minimal reproducer: 0 (yes, just that, in a .py file) |
pip list
from the virtual environment you are usinguse
pytest -k xxx
, report an error:TypeError: argument of type 'int' is not iterable
it seems a error in collecting testcase
The text was updated successfully, but these errors were encountered: