Specifically, this import fails when using a qualified name:
# First let's try python3, without python2 path
defaultpy="/usr/bin/python3"
import_error=$(adb shell "cd /home/phablet/autopilot; $defaultpy -c 'import $TESTSUITE'")
if [ -n "$import_error" ]; then
echo 'running with python2'
defaultpy="PYTHONPATH=/home/phablet/autopilot/legacy-py2:/home/phablet/autopilot /usr/bin/python"
fi
So if you run like this, it's a simple name and imports fine
phablet-test-run ubuntu_clock_app
if you run like this, it fails to import, causing it to fallback to python2:
Specifically, this import fails when using a qualified name:
# First let's try python3, without python2 path "/usr/bin/ python3" error=$ (adb shell "cd /home/phablet/ autopilot; $defaultpy -c 'import $TESTSUITE'") "PYTHONPATH= /home/phablet/ autopilot/ legacy- py2:/home/ phablet/ autopilot /usr/bin/python"
defaultpy=
import_
if [ -n "$import_error" ]; then
echo 'running with python2'
defaultpy=
fi
So if you run like this, it's a simple name and imports fine
phablet-test-run ubuntu_clock_app
if you run like this, it fails to import, causing it to fallback to python2:
phablet-test-run ubuntu_ clock_app. tests.testMainV iew