google / mobly

E2E test framework for tests with complex environment requirements.
https://github.com/google/mobly
Apache License 2.0
621 stars 174 forks source link

Add type hint for `current_test_info` #879

Closed nkprasad12 closed 1 year ago

nkprasad12 commented 1 year ago

This change is Reviewable

nkprasad12 commented 1 year ago

Reviewed all commit messages. Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @nkprasad12)

_mobly/base_test.py line 58 at r1 (raw file):_

    'PLACEHOLDER',
    '/dev/null',
    _PLACEHOLDER_RECORD)

Should we have a way to ensure that the placeholder RuntimeTestInfo properties are never actually accessed?

For instance the output_path property makes a call to utils.create_dir, which could cause problems if called on the placeholder.

I've replaced this with just setting a type for current_test_info with an explanatory comment.