ImportError: Start directory is not importable on valid test folder

Bug #1394932 reported by Christian Dywan on 2014-11-21
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
phablet-tools (Ubuntu)
Critical
Unassigned

Bug Description

I can't run a particular AutoPilot test case that, it turns out, runs with autopilot3 just fine:

adb shell
> autopilot3 run ubuntuuitoolkit.tests.test_launcher.LauncherQtTestTestCase.test_can_run_qt_test_case -v

Ran 1 test in 2.504s
OK

^^ Works

$ phablet-test-run ubuntuuitoolkit.tests.test_launcher
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/autopilot/run.py", line 380, in _discover_test
top_level_dir=top_level_dir
File "/usr/lib/python3.4/unittest/loader.py", line 261, in discover
raise ImportError('Start directory is not importable: %r' % start_dir)
ImportError: Start directory is not importable: 'ubuntuuitoolkit.tests.test_launcher'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/bin/autopilot3", line 9, in <module>
load_entry_point('autopilot==1.5.0', 'console_scripts', 'autopilot3')()
File "/usr/lib/python3/dist-packages/autopilot/run.py", line 742, in main
test_app.run()
File "/usr/lib/python3/dist-packages/autopilot/run.py", line 628, in run
action()
File "/usr/lib/python3/dist-packages/autopilot/run.py", line 666, in run_tests
self.args.suite
File "/usr/lib/python3/dist-packages/autopilot/run.py", line 470, in load_test_suite_from_name
all_tests, error_occured = _discover_requested_tests(test_names)
File "/usr/lib/python3/dist-packages/autopilot/run.py", line 402, in _discover_requested_tests
test, top_level_dir = _discover_test(name)
File "/usr/lib/python3/dist-packages/autopilot/run.py", line 384, in _discover_test
test = loader.loadTestsFromName(test_name)
File "/usr/lib/python3.4/unittest/loader.py", line 114, in loadTestsFromName
parent, obj = obj, getattr(obj, part)
AttributeError: 'module' object has no attribute 'test_launcher'
/usr/bin/phablet-test-run: 128: return: Illegal number: 1

adb shell
> ls /usr/lib/python3/dist-packages/ubuntuuitoolkit/tests
/usr/lib/python3/dist-packages/ubuntuuitoolkit/tests/test_launcher.py
/usr/lib/python3/dist-packages/ubuntuuitoolkit/tests/test_launcher.testcase.qml
/usr/lib/python3/dist-packages/ubuntuuitoolkit/tests/test_launcher.touch.qml

phablet-test-run ubuntuuitoolkit.tests.test_launcher.LauncherQtTestTestCase.test_can_run_qt_test_case -v
09:46:50.241 INFO run:235 - Autopilot Source Version: 1.5.0
Autopilot Package Version: 1.5.0+15.04.20141031-0ubuntu1
09:46:50.312 WARNING emulators:26 - The ubuntuuitoolkit.emulators module is deprecated. Import the autopilot helpers from the top-level ubuntuuitoolkit module.
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/autopilot/run.py", line 380, in _discover_test
top_level_dir=top_level_dir
File "/usr/lib/python3.4/unittest/loader.py", line 261, in discover
raise ImportError('Start directory is not importable: %r' % start_dir)
ImportError: Start directory is not importable: 'ubuntuuitoolkit.tests.test_launcher.LauncherQtTestTestCase.test_can_run_qt_test_case'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/bin/autopilot3", line 9, in <module>
load_entry_point('autopilot==1.5.0', 'console_scripts', 'autopilot3')()
File "/usr/lib/python3/dist-packages/autopilot/run.py", line 742, in main
test_app.run()
File "/usr/lib/python3/dist-packages/autopilot/run.py", line 628, in run
action()
File "/usr/lib/python3/dist-packages/autopilot/run.py", line 666, in run_tests
self.args.suite
File "/usr/lib/python3/dist-packages/autopilot/run.py", line 470, in load_test_suite_from_name
all_tests, error_occured = _discover_requested_tests(test_names)
File "/usr/lib/python3/dist-packages/autopilot/run.py", line 402, in _discover_requested_tests
test, top_level_dir = _discover_test(name)
File "/usr/lib/python3/dist-packages/autopilot/run.py", line 384, in _discover_test
test = loader.loadTestsFromName(test_name)
File "/usr/lib/python3.4/unittest/loader.py", line 114, in loadTestsFromName
parent, obj = obj, getattr(obj, part)
AttributeError: 'module' object has no attribute 'test_launcher'
/usr/bin/phablet-test-run: 128: return: Illegal number: 1

^^ Fails

Code is in lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/autoPilotQtTestLanding

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in phablet-tools (Ubuntu):
status: New → Confirmed
summary: - ImportError: Start directory is not importable on valid test folder
+ Buy Cialis Online to Handle Sexual Problems Effectively
description: updated
Manfred Hampl (m-hampl) on 2019-07-01
description: updated
summary: - Buy Cialis Online to Handle Sexual Problems Effectively
+ ImportError: Start directory is not importable on valid test folder
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers