From 26724811797e104fce8cde6bfb1c54f85f0b1001 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jan=C3=9Fen?= Date: Sat, 29 Jul 2023 23:39:34 -0600 Subject: [PATCH] Add test for raising thread --- tests/test_thread.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/test_thread.py diff --git a/tests/test_thread.py b/tests/test_thread.py new file mode 100644 index 00000000..8fb1fddd --- /dev/null +++ b/tests/test_thread.py @@ -0,0 +1,14 @@ +import unittest +from pympipool.shared.thread import RaisingThread + + +def raise_error(): + raise ValueError + + +class TestRaisingThread(unittest.TestCase): + def test_raising_thread(self): + with self.assertRaises(ValueError): + process = RaisingThread(target=raise_error) + process.start() + process.join()