diff options
author | Tom Rini <trini@konsulko.com> | 2019-11-01 09:23:21 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-11-01 09:23:21 -0400 |
commit | 82679624f9aa6d1be733c46f3555d5166b6f5b72 (patch) | |
tree | 8a99cf79bc520b833e155094ef134c0526b1f005 /test/py/test.py | |
parent | 412326d1bc2d346d7b4faad6fa547eaf065681a2 (diff) | |
parent | 5d80a1a93d42c8325d65516cc654ff6a9ceec58a (diff) |
Merge branch '2019-10-30-master-imports'
- Migrate test.py to use python3 and current pytest.
- NVMe bugfixes
- Assorted other fixes
- Android AVB updates.
Diffstat (limited to 'test/py/test.py')
-rwxr-xr-x | test/py/test.py | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/test/py/test.py b/test/py/test.py index a5140945d4b..bee88d96bc2 100755 --- a/test/py/test.py +++ b/test/py/test.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0 # Copyright (c) 2015 Stephen Warren @@ -7,28 +7,14 @@ # Wrapper script to invoke pytest with the directory name that contains the # U-Boot tests. -from __future__ import print_function - import os import os.path import sys - -# Get rid of argv[0] -sys.argv.pop(0) +from pkg_resources import load_entry_point # argv; py.test test_directory_name user-supplied-arguments -args = ['py.test', os.path.dirname(__file__) + '/tests'] +args = [os.path.dirname(__file__) + '/tests'] args.extend(sys.argv) -try: - os.execvp('py.test', args) -except: - # Log full details of any exception for detailed analysis - import traceback - traceback.print_exc() - # Hint to the user that they likely simply haven't installed the required - # dependencies. - print(''' -exec(py.test) failed; perhaps you are missing some dependencies? -See test/py/README.md for the list.''', file=sys.stderr) - sys.exit(1) +if __name__ == '__main__': + sys.exit(load_entry_point('pytest', 'console_scripts', 'pytest')(args)) |