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

Improved error import exception tests #968

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented Nov 30, 2017

Fixes #953

When attempting to load db tests through the loadTestsFromName of the
test loader that contained import errors, an AttributeError would be
thrown with the cryptic message

AttributeError: 'module' object has no attribute 'process'

To provide a more clear description of the problem we put the call to
load the tests in a try except block and catch the AttributeError.
If it is caught we attempt to import it, which should then trigger the
actual import error, which we then print to screen and exit

…rror

When attempting to load db tests through the loadTestsFromName of the
test loader that contained import errors, an AttributeError would be
thrown with the cryptic message

	AttributeError: 'module' object has no attribute 'process'

To provide a more clear description of the problem we put the call to
load the tests in a try except block and catch the AttributeError.
If it is caught we attempt to import it, which should then trigger the
actual import error, which we then print to screen and exit
Copy link
Contributor

@DropD DropD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this should be helpful indeed.

@sphuber sphuber merged commit f3bc13d into aiidateam:release_v0.10.1 Nov 30, 2017
@sphuber sphuber deleted the fix_953_improved_error_import_exception_tests branch November 30, 2017 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants