]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-106193: Rename and fix duplicated tests in `test_monitoring` (GH-109139)
authorHugo van Kemenade <hugovk@users.noreply.github.com>
Thu, 12 Oct 2023 07:43:58 +0000 (09:43 +0200)
committerGitHub <noreply@github.com>
Thu, 12 Oct 2023 07:43:58 +0000 (08:43 +0100)
Lib/test/test_monitoring.py

index 2100d998ff0808b6aa3cb072049fb122b749cf39..3b8ecb765c23f0cf07ef5c6a32c509a74420c206 100644 (file)
@@ -1185,7 +1185,7 @@ class TestLineAndInstructionEvents(CheckEvents):
         sys.monitoring.set_events(TEST_TOOL, 0)
         self.assertGreater(len(events), 0)
 
-class TestInstallIncrementallly(MonitoringTestBase, unittest.TestCase):
+class TestInstallIncrementally(MonitoringTestBase, unittest.TestCase):
 
     def check_events(self, func, must_include, tool=TEST_TOOL, recorders=(ExceptionRecorder,)):
         try:
@@ -1214,19 +1214,19 @@ class TestInstallIncrementallly(MonitoringTestBase, unittest.TestCase):
 
     MUST_INCLUDE_LI = [
             ('instruction', 'func1', 2),
-            ('line', 'func1', 1),
+            ('line', 'func1', 2),
             ('instruction', 'func1', 4),
             ('instruction', 'func1', 6)]
 
     def test_line_then_instruction(self):
         recorders = [ LineRecorder, InstructionRecorder ]
         self.check_events(self.func1,
-                          recorders = recorders, must_include = self.EXPECTED_LI)
+                          recorders = recorders, must_include = self.MUST_INCLUDE_LI)
 
     def test_instruction_then_line(self):
-        recorders = [ InstructionRecorder, LineRecorderLowNoise ]
+        recorders = [ InstructionRecorder, LineRecorder ]
         self.check_events(self.func1,
-                          recorders = recorders, must_include = self.EXPECTED_LI)
+                          recorders = recorders, must_include = self.MUST_INCLUDE_LI)
 
     @staticmethod
     def func2():
@@ -1241,12 +1241,12 @@ class TestInstallIncrementallly(MonitoringTestBase, unittest.TestCase):
 
 
 
-    def test_line_then_instruction(self):
+    def test_call_then_instruction(self):
         recorders = [ CallRecorder, InstructionRecorder ]
         self.check_events(self.func2,
                           recorders = recorders, must_include = self.MUST_INCLUDE_CI)
 
-    def test_instruction_then_line(self):
+    def test_instruction_then_call(self):
         recorders = [ InstructionRecorder, CallRecorder ]
         self.check_events(self.func2,
                           recorders = recorders, must_include = self.MUST_INCLUDE_CI)