Delete Python 2 embedded launcher test.
There are no remaining Python 2 binaries using an embedded
launcher in Android.
Bug: 245854393
Test: m par_test py2-cmd py3-cmd && build/soong/python/tests/runtest.sh
Change-Id: I241bbaa417060b51b4d2883011ccb43e22ace4c8
diff --git a/python/python.go b/python/python.go
index 1a12973..8fde638 100644
--- a/python/python.go
+++ b/python/python.go
@@ -265,7 +265,6 @@
}
if proptools.BoolDefault(props.Version.Py2.Enabled, false) {
if !mctx.DeviceConfig().BuildBrokenUsesSoongPython2Modules() &&
- mctx.ModuleName() != "par_test" &&
mctx.ModuleName() != "py2-cmd" &&
mctx.ModuleName() != "py2-stdlib" {
mctx.PropertyErrorf("version.py2.enabled", "Python 2 is no longer supported, please convert to python 3. This error can be temporarily overridden by setting BUILD_BROKEN_USES_SOONG_PYTHON2_MODULES := true in the product configuration")
diff --git a/python/tests/Android.bp b/python/tests/Android.bp
index a656859..e5569ba 100644
--- a/python/tests/Android.bp
+++ b/python/tests/Android.bp
@@ -28,29 +28,6 @@
unit_test: false,
},
version: {
- py2: {
- enabled: true,
- embedded_launcher: true,
- },
- py3: {
- enabled: false,
- embedded_launcher: true,
- },
- },
-}
-
-python_test_host {
- name: "par_test3",
- main: "par_test.py",
- srcs: [
- "par_test.py",
- "testpkg/par_test.py",
- ],
- // Is not implemented as a python unittest
- test_options: {
- unit_test: false,
- },
- version: {
py3: {
embedded_launcher: true,
},
diff --git a/python/tests/py-cmd_test.py b/python/tests/py-cmd_test.py
index acda2d7..c7ba0ab 100644
--- a/python/tests/py-cmd_test.py
+++ b/python/tests/py-cmd_test.py
@@ -57,7 +57,7 @@
if sys.version_info[0] == 2:
assert_equal("len(sys.path)", len(sys.path), 4)
- assert_equal("sys.path[0]", sys.path[0], os.path.dirname(__file__))
+ assert_equal("sys.path[0]", sys.path[0], os.path.abspath(os.path.dirname(__file__)))
assert_equal("sys.path[1]", sys.path[1], "/extra")
assert_equal("sys.path[2]", sys.path[2], os.path.join(sys.executable, "internal"))
assert_equal("sys.path[3]", sys.path[3], os.path.join(sys.executable, "internal", "stdlib"))
diff --git a/python/tests/runtest.sh b/python/tests/runtest.sh
index 35941dc..f4abae5 100755
--- a/python/tests/runtest.sh
+++ b/python/tests/runtest.sh
@@ -24,10 +24,9 @@
fi
if [[ ( ! -f $ANDROID_HOST_OUT/nativetest64/par_test/par_test ) ||
- ( ! -f $ANDROID_HOST_OUT/nativetest64/par_test3/par_test3 ) ||
( ! -f $ANDROID_HOST_OUT/bin/py2-cmd ) ||
( ! -f $ANDROID_HOST_OUT/bin/py3-cmd )]]; then
- echo "Run 'm par_test par_test3 py2-cmd py3-cmd' first"
+ echo "Run 'm par_test py2-cmd py3-cmd' first"
exit 1
fi
@@ -41,12 +40,6 @@
ARGTEST=true $ANDROID_HOST_OUT/nativetest64/par_test/par_test --arg1 arg2
-PYTHONHOME= PYTHONPATH= $ANDROID_HOST_OUT/nativetest64/par_test3/par_test3
-PYTHONHOME=/usr $ANDROID_HOST_OUT/nativetest64/par_test3/par_test3
-PYTHONPATH=/usr $ANDROID_HOST_OUT/nativetest64/par_test3/par_test3
-
-ARGTEST=true $ANDROID_HOST_OUT/nativetest64/par_test3/par_test3 --arg1 arg2
-
cd $(dirname ${BASH_SOURCE[0]})
PYTHONPATH=/extra $ANDROID_HOST_OUT/bin/py2-cmd py-cmd_test.py
diff --git a/python/tests/testpkg/par_test.py b/python/tests/testpkg/par_test.py
index b513409..e12c527 100644
--- a/python/tests/testpkg/par_test.py
+++ b/python/tests/testpkg/par_test.py
@@ -33,11 +33,7 @@
fileName = fileName[:-1]
assert_equal("__file__", fileName, os.path.join(archive, "testpkg/par_test.py"))
-# Python3 is returning None here for me, and I haven't found any problems caused by this.
-if sys.version_info[0] == 2:
- assert_equal("__package__", __package__, "testpkg")
-else:
- assert_equal("__package__", __package__, None)
+assert_equal("__package__", __package__, "testpkg")
assert_equal("__loader__.archive", __loader__.archive, archive)
assert_equal("__loader__.prefix", __loader__.prefix, "testpkg/")