Ask Your Question
0

run_test.py w/ new directory

asked 2011-08-18 17:50:29 -0600

fred-yang gravatar image

Hi,

I have created a new subdiretory ~/nova/nova/attestation with a new file service.py. I have also create a new unit test under ~/nova/tests/scheduler/test_attestation.py where has "from nova.attestation import service"

When I run "python run_tests.py scheduler.test_attestation:TestAttestation.test_sdk", I am experiencing following error. that can't locate attestation directory. Do I need to specify new created directory in anyplace for testing?

Thanks,

fred@storky:~/d2/nova$ python run_tests.py scheduler.test_attestation:TestAttestation.test_sdk 2011-08-18 10:37:51,066 INFO rdflib [-] version: 2.4.2 Failure runTest ERROR

======================================================================

ERROR: Failure: ImportError (No module named attestation)

Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/nose/loader.py", line 382, in loadTestsFromName addr.filename, addr.module) File "/usr/lib/pymodules/python2.7/nose/importer.py", line 39, in importFromPath return self.importFromDir(dir_path, fqname) File "/usr/lib/pymodules/python2.7/nose/importer.py", line 86, in importFromDir mod = load_module(part_fqname, fh, filename, desc) File "/home/fred/d2/nova/nova/tests/scheduler/test_attestation.py", line 40, in <module> from nova.attestation import service ImportError: No module named attestation


Ran 1 test in 0.001s

FAILED (errors=1)

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
0

answered 2011-08-19 14:17:59 -0600

fred-yang gravatar image

Thanks Brian Lamar, that solved my question.

edit flag offensive delete link more
0

answered 2011-08-19 13:33:49 -0600

blamar gravatar image

Make sure your 'attestation' directory contains an __init__.py file. Python requires these files to certify that the directory is a module.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2011-08-18 17:50:29 -0600

Seen: 33 times

Last updated: Aug 19 '11