diff options
author | 2022-09-20 02:16:33 +0000 | |
---|---|---|
committer | 2023-05-04 17:52:12 +0000 | |
commit | ebb25bd22e87df67006f07d116d3bfc43c91866d (patch) | |
tree | 9fb95c479f74b02d23c31d2c109664d857809c88 | |
parent | acb7f7a7ce75c9b9ee82f715468f7ad90cdba23c (diff) |
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
-rw-r--r-- | python/python.go | 1 | ||||
-rw-r--r-- | python/tests/Android.bp | 23 | ||||
-rw-r--r-- | python/tests/py-cmd_test.py | 2 | ||||
-rwxr-xr-x | python/tests/runtest.sh | 9 | ||||
-rw-r--r-- | python/tests/testpkg/par_test.py | 6 |
5 files changed, 3 insertions, 38 deletions
diff --git a/python/python.go b/python/python.go index 1a129737a..8fde638b4 100644 --- a/python/python.go +++ b/python/python.go @@ -265,7 +265,6 @@ func versionSplitMutator() func(android.BottomUpMutatorContext) { } 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 a65685960..e5569ba87 100644 --- a/python/tests/Android.bp +++ b/python/tests/Android.bp @@ -28,29 +28,6 @@ python_test_host { 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 acda2d742..c7ba0ab4b 100644 --- a/python/tests/py-cmd_test.py +++ b/python/tests/py-cmd_test.py @@ -57,7 +57,7 @@ assert_equal("site.ENABLE_USER_SITE", site.ENABLE_USER_SITE, None) 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 35941dc88..f4abae587 100755 --- a/python/tests/runtest.sh +++ b/python/tests/runtest.sh @@ -24,10 +24,9 @@ if [ -z $ANDROID_HOST_OUT ]; then 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 @@ PYTHONPATH=/usr $ANDROID_HOST_OUT/nativetest64/par_test/par_test 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 b51340907..e12c527ad 100644 --- a/python/tests/testpkg/par_test.py +++ b/python/tests/testpkg/par_test.py @@ -33,11 +33,7 @@ if fileName.endswith('.pyc'): 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/") |