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

debugging: more helpful error message for db-tests in case of import error #953

Closed
DropD opened this issue Nov 28, 2017 · 1 comment
Closed
Labels
good first issue Issues that should be relatively easy to fix also for beginning contributors priority/quality-of-life would simplify development topic/testing

Comments

@DropD
Copy link
Contributor

DropD commented Nov 28, 2017

Description

The following type of error message is common when running aiida tests in case of import errors (missing dependencies for instance).

File ".../aiida-core/aiida/backends/testbase.py", line 165, in run_aiida_db_tests
    test_suite.addTest(test_loader.loadTestsFromName(modulename))
  File ".../lib/python2.7/unittest/loader.py", line 100, in loadTestsFromName
    parent, obj = obj, getattr(obj, part)
AttributeError: 'module' object has no attribute 'persistence'

The error message could easily be very helpful if only the name of the module was output too

Possible solution

The AttributeError could be caught in run_aiida_db_tests in aiida/backends/testase.py and the more helpful message could be output containing the modulename.

@DropD DropD added topic/testing type/enhancement good first issue Issues that should be relatively easy to fix also for beginning contributors labels Nov 28, 2017
@DropD DropD changed the title debugging: more helpful error messages debugging: more helpful error message for db-tests in case of import error Nov 28, 2017
@DropD DropD added the priority/quality-of-life would simplify development label Nov 28, 2017
@sphuber
Copy link
Contributor

sphuber commented Nov 30, 2017

Fixed in #968

@sphuber sphuber closed this as completed Nov 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issues that should be relatively easy to fix also for beginning contributors priority/quality-of-life would simplify development topic/testing
Projects
None yet
Development

No branches or pull requests

2 participants