Skip to content
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

Better error message on syntax errors. #154

Closed
pytestbot opened this issue Jun 4, 2012 · 1 comment
Closed

Better error message on syntax errors. #154

pytestbot opened this issue Jun 4, 2012 · 1 comment
Labels
type: enhancement new feature or API change, should be merged into features branch

Comments

@pytestbot
Copy link
Contributor

Originally reported by: Jurko Gospodnetić (BitBucket: jurko, GitHub: jurko)


When pytest is run on the following module:

def f(): return []
f() += [5]

It reports a confusing error message:

E   SystemError: ..\Objects\tupleobject.c:126: bad argument to internal function

While when that same module is run directly it reports a clearer:

SyntaxError: can't assign to function call

On other types of errors (e.g. replace the last line of the initial script with just 'foo'), error messages returned by pytest & direct Python calls match.

Can the error message presented by pytest be improved?

Tested using pytest 2.2.4 on Windows 7 x64 with 64bit Python 3.2.3.

Best regards,
Jurko Gospodnetić


@pytestbot
Copy link
Contributor Author

Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt):


works in recent py.test

@pytestbot pytestbot added the type: enhancement new feature or API change, should be merged into features branch label Jun 15, 2015
fkohlgrueber pushed a commit to fkohlgrueber/pytest that referenced this issue Oct 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement new feature or API change, should be merged into features branch
Projects
None yet
Development

No branches or pull requests

1 participant