From 11bc3fa3a861d53aa387bb21d26d0d36e961fd78 Mon Sep 17 00:00:00 2001 From: Lane Kolbly Date: Tue, 3 Mar 2020 13:00:20 -0600 Subject: mpm: Make contextmanagers exception-safe When making context managers in Python, the yield statement has to be wrapped in a try/finally clause in order to properly clean up after exceptions happen. --- mpm/python/tests/run_unit_tests.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'mpm/python/tests/run_unit_tests.py') diff --git a/mpm/python/tests/run_unit_tests.py b/mpm/python/tests/run_unit_tests.py index 26fc0e1fb..88ea1a805 100755 --- a/mpm/python/tests/run_unit_tests.py +++ b/mpm/python/tests/run_unit_tests.py @@ -11,13 +11,17 @@ import unittest import sys import argparse from sys_utils_tests import TestNet +from mpm_utils_tests import TestMpmUtils import importlib.util if importlib.util.find_spec("xmlrunner"): from xmlrunner import XMLTestRunner TESTS = { - '__all__': {TestNet}, + '__all__': { + TestNet, + TestMpmUtils, + }, 'n3xx': set(), } -- cgit v1.2.3