diff options
author | Martin Braun <martin.braun@ettus.com> | 2020-06-09 18:44:16 +0200 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-06-10 12:46:33 -0500 |
commit | f832a176d997713b1b0c515d4a7fdb217a0c855a (patch) | |
tree | 4eda40e1a330d49749b56dabf565fdbeea5a6c76 /host/tests/devtest | |
parent | 6db281792b57e42d9c6456aa94e17e7b7d12690a (diff) | |
download | uhd-f832a176d997713b1b0c515d4a7fdb217a0c855a.tar.gz uhd-f832a176d997713b1b0c515d4a7fdb217a0c855a.tar.bz2 uhd-f832a176d997713b1b0c515d4a7fdb217a0c855a.zip |
devtest: Assert result of python_api_test correctly
Before this, the python_api_test didn't assert an error when it failed.
Diffstat (limited to 'host/tests/devtest')
-rw-r--r-- | host/tests/devtest/python_api_test.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/host/tests/devtest/python_api_test.py b/host/tests/devtest/python_api_test.py index 0e2ca45f7..9d879cae3 100644 --- a/host/tests/devtest/python_api_test.py +++ b/host/tests/devtest/python_api_test.py @@ -14,6 +14,13 @@ try: except ImportError: uhd = None +# For what we're doing here, ruamel.yaml and yaml are compatible, and we'll use +# whatever we can find +try: + from ruamel import yaml +except: + import yaml + class uhd_python_api_test(uhd_test_case): """ Run multi_usrp_test """ @@ -59,3 +66,11 @@ class uhd_python_api_test(uhd_test_case): 'status', 'Passed' if run_results['passed'] else 'Failed', ) + self.assertTrue( + run_results['passed'], + msg="Errors occurred during test python_api_test. " + "Check log file for details.\n" + "Run results:\n{r}".format( + r=yaml.dump(run_results, default_flow_style=False) + ) + ) |