From f832a176d997713b1b0c515d4a7fdb217a0c855a Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 9 Jun 2020 18:44:16 +0200 Subject: devtest: Assert result of python_api_test correctly Before this, the python_api_test didn't assert an error when it failed. --- host/tests/devtest/python_api_test.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'host/tests/devtest') 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) + ) + ) -- cgit v1.2.3