From 4eca49e30eb08becae65377bba8aa244a78c3eb5 Mon Sep 17 00:00:00 2001 From: Ross Brattain Date: Wed, 12 Jul 2017 18:04:03 -0700 Subject: NSBperf: fix bad sigint handler This is why we don't do things at module import time. when we import this module it makes a bad sigint handler. Only load signal handlers at runtime. Also fix handler to take *args, **kwargs. Unittest failures: > time.sleep(0.01) E TypeError: handler() takes 0 positional arguments but 2 were given Change-Id: I4296a4bdef0e5f4d58b0503dcbc834f3bef0feeb Signed-off-by: Ross Brattain --- tests/unit/cmd/test_NSBperf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/unit/cmd') diff --git a/tests/unit/cmd/test_NSBperf.py b/tests/unit/cmd/test_NSBperf.py index 5bd248a84..e1b4da7fc 100644 --- a/tests/unit/cmd/test_NSBperf.py +++ b/tests/unit/cmd/test_NSBperf.py @@ -29,7 +29,7 @@ from yardstick.cmd import NSBperf class TestHandler(unittest.TestCase): def test_handler(self, test): subprocess.call = mock.Mock(return_value=0) - self.assertRaises(SystemExit, NSBperf.handler) + self.assertRaises(SystemExit, NSBperf.sigint_handler) class TestYardstickNSCli(unittest.TestCase): -- cgit 1.2.3-korg