Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Python test files should not mask ImportErrors #2

@kytrinyx

Description

@kytrinyx

Copied from exercism/exercism#1376 - reported by @hop

Please see the original discussion for details.


In case there is an import error in the implementation of the exercise, the misleading error message 'Could not find wordcount.py. Does it exist?' is emitted and the original error message is hidden.

I'm not entirely sure what a good alternative would look like, but something like this would be a start:

try:
    from foo import Bar
except ImportError as e:
    raise SystemExit('Could not import foo.py.' 
                     'This was the error: '+str(e))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions