Starting March 27, 2025, we recommend using android-latest-release
instead of aosp-main
to build and contribute to AOSP. For more information, see Changes to AOSP.
Stay organized with collections
Save and categorize content based on your preferences.
PythonUnitTestRunner
public
class
PythonUnitTestRunner
extends Object
implements
IBuildReceiver,
IRemoteTest
java.lang.Object
|
↳ |
com.android.tradefed.testtype.PythonUnitTestRunner
|
This class is deprecated.
Use PythonBinaryHostTest
instead.
Runs Python tests written with the unittest library.
Summary
Public constructors
PythonUnitTestRunner
public PythonUnitTestRunner ()
Public methods
setBuild
public void setBuild (IBuildInfo buildInfo)
Parameters |
buildInfo |
IBuildInfo |
Protected methods
checkPythonVersion
protected void checkPythonVersion (CommandResult c)
Parameters |
c |
CommandResult |
getRunUtil
protected IRunUtil getRunUtil ()
Returns an IRunUtil
that runs the unittest
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-08-13 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-13 UTC."],[],[],null,["# PythonUnitTestRunner\n====================\n\n\n`\npublic\n\n\nclass\nPythonUnitTestRunner\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\nimplements\n\n`[IBuildReceiver](../../../../../../reference/tradefed/com/android/tradefed/testtype/IBuildReceiver.html)`,\n\n`[IRemoteTest](../../../../../../reference/tradefed/com/android/tradefed/testtype/IRemoteTest.html)`\n\n\n`\n\n|---|----------------------------------------------------|\n| java.lang.Object ||\n| ↳ | com.android.tradefed.testtype.PythonUnitTestRunner |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n\n**This class is deprecated.** \n\nUse [PythonBinaryHostTest](../../../../../../reference/tradefed/com/android/tradefed/testtype/python/PythonBinaryHostTest.html) instead.\n\nRuns Python tests written with the unittest library.\n\nSummary\n-------\n\n| ### Public constructors ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[PythonUnitTestRunner](../../../../../../reference/tradefed/com/android/tradefed/testtype/PythonUnitTestRunner.html#PythonUnitTestRunner())`() ` |\n\n| ### Public methods ||\n|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` void` | ` `[run](../../../../../../reference/tradefed/com/android/tradefed/testtype/PythonUnitTestRunner.html#run(com.android.tradefed.invoker.TestInformation,%20com.android.tradefed.result.ITestInvocationListener))`(`[TestInformation](../../../../../../reference/tradefed/com/android/tradefed/invoker/TestInformation.html)` testInfo, `[ITestInvocationListener](../../../../../../reference/tradefed/com/android/tradefed/result/ITestInvocationListener.html)` listener) ` Runs the tests, and reports result to the listener. |\n| ` void` | ` `[setBuild](../../../../../../reference/tradefed/com/android/tradefed/testtype/PythonUnitTestRunner.html#setBuild(com.android.tradefed.build.IBuildInfo))`(`[IBuildInfo](../../../../../../reference/tradefed/com/android/tradefed/build/IBuildInfo.html)` buildInfo) ` |\n\n| ### Protected methods ||\n|--------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` void` | ` `[checkPythonVersion](../../../../../../reference/tradefed/com/android/tradefed/testtype/PythonUnitTestRunner.html#checkPythonVersion(com.android.tradefed.util.CommandResult))`(`[CommandResult](../../../../../../reference/tradefed/com/android/tradefed/util/CommandResult.html)` c) ` |\n| ` `[IBuildInfo](../../../../../../reference/tradefed/com/android/tradefed/build/IBuildInfo.html) | ` `[getBuild](../../../../../../reference/tradefed/com/android/tradefed/testtype/PythonUnitTestRunner.html#getBuild())`() ` Returns the [IBuildInfo](../../../../../../reference/tradefed/com/android/tradefed/build/IBuildInfo.html) for this invocation. |\n| ` `[IRunUtil](../../../../../../reference/tradefed/com/android/tradefed/util/IRunUtil.html) | ` `[getRunUtil](../../../../../../reference/tradefed/com/android/tradefed/testtype/PythonUnitTestRunner.html#getRunUtil())`() ` Returns an [IRunUtil](../../../../../../reference/tradefed/com/android/tradefed/util/IRunUtil.html) that runs the unittest |\n\nPublic constructors\n-------------------\n\n### PythonUnitTestRunner\n\n```\npublic PythonUnitTestRunner ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### run\n\n```\npublic void run (TestInformation testInfo, \n ITestInvocationListener listener)\n```\n\nRuns the tests, and reports result to the listener.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `testInfo` | `TestInformation`: The [TestInformation](../../../../../../reference/tradefed/com/android/tradefed/invoker/TestInformation.html) object containing useful information to run tests. \u003cbr /\u003e |\n| `listener` | `ITestInvocationListener`: the [ITestInvocationListener](../../../../../../reference/tradefed/com/android/tradefed/result/ITestInvocationListener.html) of test results \u003cbr /\u003e |\n\n| Throws ||\n|----------------------------------------------------------------------------------------------------------------------------------|---|\n| [DeviceNotAvailableException](../../../../../../reference/tradefed/com/android/tradefed/device/DeviceNotAvailableException.html) | |\n\n### setBuild\n\n```\npublic void setBuild (IBuildInfo buildInfo)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------|---------------------|\n| `buildInfo` | `IBuildInfo` \u003cbr /\u003e |\n\nProtected methods\n-----------------\n\n### checkPythonVersion\n\n```\nprotected void checkPythonVersion (CommandResult c)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----|------------------------|\n| `c` | `CommandResult` \u003cbr /\u003e |\n\n### getBuild\n\n```\nprotected IBuildInfo getBuild ()\n```\n\nReturns the [IBuildInfo](../../../../../../reference/tradefed/com/android/tradefed/build/IBuildInfo.html) for this invocation.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-----------------------------------------------------------------------------------------------|--------|\n| [IBuildInfo](../../../../../../reference/tradefed/com/android/tradefed/build/IBuildInfo.html) | \u003cbr /\u003e |\n\n### getRunUtil\n\n```\nprotected IRunUtil getRunUtil ()\n```\n\nReturns an [IRunUtil](../../../../../../reference/tradefed/com/android/tradefed/util/IRunUtil.html) that runs the unittest\n\n\u003cbr /\u003e\n\n| Returns ||\n|------------------------------------------------------------------------------------------|--------|\n| [IRunUtil](../../../../../../reference/tradefed/com/android/tradefed/util/IRunUtil.html) | \u003cbr /\u003e |"]]