diff options
| author | Jordan Rupprecht <rupprecht@google.com> | 2024-02-21 13:02:30 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-21 13:02:30 -0600 |
| commit | 9c2468821ec51defd09c246fea4a47886fff8c01 (patch) | |
| tree | 37781dd1ecd1e72faad5215f06e5a1579106b451 /lldb/test/API/python_api/module_section/TestModuleAndSection.py | |
| parent | 4247175d4536964322b129d1d3bbe6128da653bf (diff) | |
[lldb][test] Modernize asserts (#82503)
This uses [teyit](https://pypi.org/project/teyit/) to modernize asserts,
as recommended by the [unittest release
notes](https://docs.python.org/3.12/whatsnew/3.12.html#id3).
For example, `assertTrue(a == b)` is replaced with `assertEqual(a, b)`.
This produces better error messages, e.g. `error: unexpectedly found 1
and 2 to be different` instead of `error: False`.
Diffstat (limited to 'lldb/test/API/python_api/module_section/TestModuleAndSection.py')
| -rw-r--r-- | lldb/test/API/python_api/module_section/TestModuleAndSection.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lldb/test/API/python_api/module_section/TestModuleAndSection.py b/lldb/test/API/python_api/module_section/TestModuleAndSection.py index 8a83740b0673..96b53563d5df 100644 --- a/lldb/test/API/python_api/module_section/TestModuleAndSection.py +++ b/lldb/test/API/python_api/module_section/TestModuleAndSection.py @@ -17,7 +17,7 @@ class ModuleAndSectionAPIsTestCase(TestBase): target = self.dbg.CreateTarget(exe) self.assertTrue(target, VALID_TARGET) - self.assertTrue(target.GetNumModules() > 0) + self.assertGreater(target.GetNumModules(), 0) # Hide stdout if not running with '-t' option. if not self.TraceOn(): @@ -62,7 +62,7 @@ class ModuleAndSectionAPIsTestCase(TestBase): target = self.dbg.CreateTarget(exe) self.assertTrue(target, VALID_TARGET) - self.assertTrue(target.GetNumModules() > 0) + self.assertGreater(target.GetNumModules(), 0) # Hide stdout if not running with '-t' option. if not self.TraceOn(): @@ -102,7 +102,7 @@ class ModuleAndSectionAPIsTestCase(TestBase): target = self.dbg.CreateTarget(exe) self.assertTrue(target, VALID_TARGET) - self.assertTrue(target.GetNumModules() > 0) + self.assertGreater(target.GetNumModules(), 0) # Hide stdout if not running with '-t' option. if not self.TraceOn(): |
