Skip to content

Better error message on syntax errors. #154

Closed
@pytestbot

Description

@pytestbot

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ć


Metadata

Metadata

Assignees

No one assigned

    Labels

    type: enhancementnew feature or API change, should be merged into features branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions