summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_audit.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_audit.py')
-rw-r--r--Lib/test/test_audit.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/Lib/test/test_audit.py b/Lib/test/test_audit.py
index e8d560a..5a2997a 100644
--- a/Lib/test/test_audit.py
+++ b/Lib/test/test_audit.py
@@ -186,6 +186,31 @@ class AuditTest(unittest.TestCase):
self.assertEqual(actual, expected)
+
+ def test_threading(self):
+ returncode, events, stderr = self.run_python("test_threading")
+ if returncode:
+ self.fail(stderr)
+
+ if support.verbose:
+ print(*events, sep='\n')
+ actual = [(ev[0], ev[2]) for ev in events]
+ expected = [
+ ("_thread.start_new_thread", "(<test_func>, (), None)"),
+ ("cpython.PyThreadState_New", "(2,)"),
+ ("test.test_func", "()"),
+ ("cpython.PyThreadState_Clear", "(2,)"),
+ ]
+
+ self.assertEqual(actual, expected)
+
+ def test_threading_abort(self):
+ # Ensures that aborting PyThreadState_New raises the correct exception
+ returncode, events, stderr = self.run_python("test_threading_abort")
+ if returncode:
+ self.fail(stderr)
+
+
def test_wmi_exec_query(self):
import_helper.import_module("_wmi")
returncode, events, stderr = self.run_python("test_wmi_exec_query")