diff options
author | nkprasad12 <31296089+nkprasad12@users.noreply.github.com> | 2023-04-17 19:06:19 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-17 17:06:19 -0700 |
commit | 33cc76f339c04bc3f970c8c2c434c911bd45da92 (patch) | |
tree | 2df4282962a1abadd104cfc7e726828edf6d6641 | |
parent | 384ebbe47fbc48af60d73b1bede1f78976612fc4 (diff) | |
download | mobly-33cc76f339c04bc3f970c8c2c434c911bd45da92.tar.gz |
Add type hint for `current_test_info` (#879)
* Avoid setting `current_test_info` to `None`
* Set signature of placeholder record.
* Set a type hint for current_test_info without placeholder.
* Restore setting cti to none
-rw-r--r-- | mobly/base_test.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mobly/base_test.py b/mobly/base_test.py index e7da22c..6f80ace 100644 --- a/mobly/base_test.py +++ b/mobly/base_test.py @@ -170,6 +170,12 @@ class BaseTestClass: the test logic. """ + # Explicitly set the type since we set this to `None` in between + # test cases executions when there's no active test. However, since + # it is safe for clients to call at any point during normal execution + # of a Mobly test, we avoid using the `Optional` type hint for convenience. + current_test_info: runtime_test_info.RuntimeTestInfo + TAG = None def __init__(self, configs): |