Skip to content

Commit 3cc3762

Browse files
committed
[lldb] Use assertIn/NotIn over assertTrue/False (NFC)
For improved failure messages, use `assertIn` over `assertTrue`. Differential Revision: https://reviews.llvm.org/D96095
1 parent 4b5dbc7 commit 3cc3762

File tree

39 files changed

+101
-101
lines changed

39 files changed

+101
-101
lines changed

lldb/test/API/commands/expression/dont_allow_jit/TestAllowJIT.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def expr_options_test(self):
6969
# Again use it and ensure we fail:
7070
result = frame.EvaluateExpression("call_me(10)", options)
7171
self.assertTrue(result.GetError().Fail(), "expression failed with no JIT")
72-
self.assertTrue("Can't evaluate the expression without a running target" in result.GetError().GetCString(), "Got right error")
72+
self.assertIn("Can't evaluate the expression without a running target", result.GetError().GetCString(), "Got right error")
7373

7474
# Finally set the allow JIT value back to true and make sure that works:
7575
options.SetAllowJIT(True)

lldb/test/API/commands/frame/var/TestFrameVar.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,28 +64,28 @@ def do_test(self):
6464
result = interp.HandleCommand("frame var -l", command_result)
6565
self.assertEqual(result, lldb.eReturnStatusSuccessFinishResult, "frame var -a didn't succeed")
6666
output = command_result.GetOutput()
67-
self.assertTrue("argc" in output, "Args didn't find argc")
68-
self.assertTrue("argv" in output, "Args didn't find argv")
69-
self.assertTrue("test_var" not in output, "Args found a local")
70-
self.assertTrue("g_var" not in output, "Args found a global")
67+
self.assertIn("argc", output, "Args didn't find argc")
68+
self.assertIn("argv", output, "Args didn't find argv")
69+
self.assertNotIn("test_var", output, "Args found a local")
70+
self.assertNotIn("g_var", output, "Args found a global")
7171

7272
# Just get locals:
7373
result = interp.HandleCommand("frame var -a", command_result)
7474
self.assertEqual(result, lldb.eReturnStatusSuccessFinishResult, "frame var -a didn't succeed")
7575
output = command_result.GetOutput()
76-
self.assertTrue("argc" not in output, "Locals found argc")
77-
self.assertTrue("argv" not in output, "Locals found argv")
78-
self.assertTrue("test_var" in output, "Locals didn't find test_var")
79-
self.assertTrue("g_var" not in output, "Locals found a global")
76+
self.assertNotIn("argc", output, "Locals found argc")
77+
self.assertNotIn("argv", output, "Locals found argv")
78+
self.assertIn("test_var", output, "Locals didn't find test_var")
79+
self.assertNotIn("g_var", output, "Locals found a global")
8080

8181
# Get the file statics:
8282
result = interp.HandleCommand("frame var -l -a -g", command_result)
8383
self.assertEqual(result, lldb.eReturnStatusSuccessFinishResult, "frame var -a didn't succeed")
8484
output = command_result.GetOutput()
85-
self.assertTrue("argc" not in output, "Globals found argc")
86-
self.assertTrue("argv" not in output, "Globals found argv")
87-
self.assertTrue("test_var" not in output, "Globals found test_var")
88-
self.assertTrue("g_var" in output, "Globals didn't find g_var")
85+
self.assertNotIn("argc", output, "Globals found argc")
86+
self.assertNotIn("argv", output, "Globals found argv")
87+
self.assertNotIn("test_var", output, "Globals found test_var")
88+
self.assertIn("g_var", output, "Globals didn't find g_var")
8989

9090

9191

lldb/test/API/functionalities/breakpoint/breakpoint_names/TestBreakpointNames.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,14 +288,14 @@ def do_check_configuring_names(self):
288288
name_list = lldb.SBStringList()
289289
self.target.GetBreakpointNames(name_list)
290290
for name_string in [self.bp_name_string, other_bp_name_string, cl_bp_name_string]:
291-
self.assertTrue(name_string in name_list, "Didn't find %s in names"%(name_string))
291+
self.assertIn(name_string, name_list, "Didn't find %s in names"%(name_string))
292292

293293
# Delete the name from the current target. Make sure that works and deletes the
294294
# name from the breakpoint as well:
295295
self.target.DeleteBreakpointName(self.bp_name_string)
296296
name_list.Clear()
297297
self.target.GetBreakpointNames(name_list)
298-
self.assertTrue(self.bp_name_string not in name_list, "Didn't delete %s from a real target"%(self.bp_name_string))
298+
self.assertNotIn(self.bp_name_string, name_list, "Didn't delete %s from a real target"%(self.bp_name_string))
299299
# Also make sure the name got removed from breakpoints holding it:
300300
self.assertFalse(bkpt.MatchesName(self.bp_name_string), "Didn't remove the name from the breakpoint.")
301301

@@ -305,7 +305,7 @@ def do_check_configuring_names(self):
305305
dummy_target.DeleteBreakpointName(self.bp_name_string)
306306
name_list.Clear()
307307
dummy_target.GetBreakpointNames(name_list)
308-
self.assertTrue(self.bp_name_string not in name_list, "Didn't delete %s from the dummy target"%(self.bp_name_string))
308+
self.assertNotIn(self.bp_name_string, name_list, "Didn't delete %s from the dummy target"%(self.bp_name_string))
309309
# Also make sure the name got removed from breakpoints holding it:
310310
self.assertFalse(bkpt.MatchesName(self.bp_name_string), "Didn't remove the name from the breakpoint.")
311311

lldb/test/API/functionalities/breakpoint/debugbreak/TestDebugBreak.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ def test_asm_int_3(self):
3737
# We should be in funciton 'bar'.
3838
self.assertTrue(frame.IsValid())
3939
function_name = frame.GetFunctionName()
40-
self.assertTrue('bar' in function_name,
41-
"Unexpected function name {}".format(function_name))
40+
self.assertIn('bar', function_name,
41+
"Unexpected function name {}".format(function_name))
4242

4343
# We should be able to evaluate the parameter foo.
4444
value = frame.EvaluateExpression('*foo')

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/queue/TestDataFormatterLibcxxQueue.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def check_variable(self, name):
2323
self.assertTrue(var.IsValid())
2424

2525
queue = self.namespace + '::queue'
26-
self.assertTrue(queue in var.GetDisplayTypeName())
26+
self.assertIn(queue, var.GetDisplayTypeName())
2727
self.assertEqual(var.GetNumChildren(), 5)
2828
for i in range(5):
2929
ch = var.GetChildAtIndex(i)

lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteClient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def test_read_registers_using_p_packets(self):
9696
process = self.connect(target)
9797

9898
self.read_registers(process)
99-
self.assertFalse("g" in self.server.responder.packetLog)
99+
self.assertNotIn("g", self.server.responder.packetLog)
100100
self.assertGreater(
101101
len([p for p in self.server.responder.packetLog if p.startswith("p")]), 0)
102102

lldb/test/API/functionalities/history/TestHistoryRecall.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ def sample_test(self):
3030

3131
interp.HandleCommand("!0", result, False)
3232
self.assertTrue(result.Succeeded(), "!0 command did not work: %s"%(result.GetError()))
33-
self.assertTrue("session history" in result.GetOutput(), "!0 didn't rerun session history")
33+
self.assertIn("session history", result.GetOutput(), "!0 didn't rerun session history")
3434

3535
interp.HandleCommand("!-1", result, False)
3636
self.assertTrue(result.Succeeded(), "!-1 command did not work: %s"%(result.GetError()))
37-
self.assertTrue("host:" in result.GetOutput(), "!-1 didn't rerun platform list.")
37+
self.assertIn("host:", result.GetOutput(), "!-1 didn't rerun platform list.")

lldb/test/API/functionalities/plugins/python_os_plugin/stepping_plugin_threads/TestOSPluginStepping.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,6 @@ def run_python_os_step_missing_thread(self, do_prune):
113113
self.process.Continue()
114114
os_thread = self.get_os_thread()
115115
self.assertTrue(os_thread.IsValid(), "The OS thread is back after continue")
116-
self.assertTrue("step out" in os_thread.GetStopDescription(100), "Completed step out plan")
116+
self.assertIn("step out", os_thread.GetStopDescription(100), "Completed step out plan")
117117

118118

lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpNew.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def test_memory_region_name(self):
110110
ci.HandleCommand(command, result, False)
111111
message = 'Ensure memory "%s" shows up in output for "%s"' % (
112112
region_name, command)
113-
self.assertTrue(region_name in result.GetOutput(), message)
113+
self.assertIn(region_name, result.GetOutput(), message)
114114

115115
def test_thread_info_in_minidump(self):
116116
"""Test that lldb can read the thread information from the Minidump."""
@@ -122,7 +122,7 @@ def test_thread_info_in_minidump(self):
122122
thread = self.process.GetThreadAtIndex(0)
123123
self.assertEqual(thread.GetStopReason(), lldb.eStopReasonSignal)
124124
stop_description = thread.GetStopDescription(256)
125-
self.assertTrue("SIGSEGV" in stop_description)
125+
self.assertIn("SIGSEGV", stop_description)
126126

127127
def test_stack_info_in_minidump(self):
128128
"""Test that we can see a trivial stack in a breakpad-generated Minidump."""
@@ -333,7 +333,7 @@ def do_test_deeper_stack(self, binary, core, pid):
333333
frame = thread.GetFrameAtIndex(index)
334334
self.assertTrue(frame.IsValid())
335335
function_name = frame.GetFunctionName()
336-
self.assertTrue(name in function_name)
336+
self.assertIn(name, function_name)
337337

338338
@skipIfLLVMTargetMissing("X86")
339339
def test_deeper_stack_in_minidump(self):

lldb/test/API/functionalities/postmortem/minidump/TestMiniDump.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def test_thread_info_in_mini_dump(self):
3838
thread = self.process.GetThreadAtIndex(0)
3939
self.assertEqual(thread.GetStopReason(), lldb.eStopReasonException)
4040
stop_description = thread.GetStopDescription(256)
41-
self.assertTrue("0xc0000005" in stop_description)
41+
self.assertIn("0xc0000005", stop_description)
4242

4343
def test_modules_in_mini_dump(self):
4444
"""Test that lldb can read the list of modules from the minidump."""
@@ -136,7 +136,7 @@ def test_deeper_stack_in_mini_dump(self):
136136
frame = thread.GetFrameAtIndex(index)
137137
self.assertTrue(frame.IsValid())
138138
function_name = frame.GetFunctionName()
139-
self.assertTrue(name in function_name)
139+
self.assertIn(name, function_name)
140140

141141
finally:
142142
# Clean up the mini dump file.

lldb/test/API/functionalities/process_save_core/TestProcessSaveCore.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def test_save_windows_mini_dump(self):
5656
os.path.join(
5757
f.GetDirectory(),
5858
f.GetFilename()) for f in files]
59-
self.assertTrue(exe in paths)
59+
self.assertIn(exe, paths)
6060

6161
finally:
6262
# Clean up the mini dump file.

lldb/test/API/functionalities/source-map/TestTargetSourceMap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def assertBreakpointWithSourceMap(src_path):
2424
self.dbg.GetCommandInterpreter().HandleCommand("source list -f main.c -l 2", retval)
2525
self.assertTrue(retval.Succeeded(), "source list didn't succeed.")
2626
self.assertNotEqual(retval.GetOutput(), None, "We got no ouput from source list")
27-
self.assertTrue("return" in retval.GetOutput(), "We didn't find the source file...")
27+
self.assertIn("return", retval.GetOutput(), "We didn't find the source file...")
2828

2929
# Set the target soure map to map "./" to the current test directory
3030
src_dir = self.getSourceDir()

lldb/test/API/functionalities/stats_api/TestStatisticsAPI.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def test_stats_api(self):
2828
res = stats.GetAsJSON(stream)
2929
stats_json = sorted(json.loads(stream.GetData()))
3030
self.assertEqual(len(stats_json), 4)
31-
self.assertTrue("Number of expr evaluation failures" in stats_json)
32-
self.assertTrue("Number of expr evaluation successes" in stats_json)
33-
self.assertTrue("Number of frame var failures" in stats_json)
34-
self.assertTrue("Number of frame var successes" in stats_json)
31+
self.assertIn("Number of expr evaluation failures", stats_json)
32+
self.assertIn("Number of expr evaluation successes", stats_json)
33+
self.assertIn("Number of frame var failures", stats_json)
34+
self.assertIn("Number of frame var successes", stats_json)

lldb/test/API/functionalities/step_scripted/TestStepScripted.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def test_misspelled_plan_name(self):
5959
# Make sure we got a good error:
6060
self.assertTrue(err.Fail(), "We got a failure state")
6161
msg = err.GetCString()
62-
self.assertTrue("NoSuchModule.NoSuchPlan" in msg, "Mentioned missing class")
62+
self.assertIn("NoSuchModule.NoSuchPlan", msg, "Mentioned missing class")
6363

6464
# Make sure we didn't let the process run:
6565
self.assertEqual(stop_id, process.GetStopID(), "Process didn't run")

lldb/test/API/functionalities/tail_call_frames/cross_dso/TestCrossDSOTailCalls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,5 @@ def test_cross_dso_tail_calls(self):
6161
]
6262
for idx, (name, is_artificial) in enumerate(expected_frames):
6363
frame = thread.GetFrameAtIndex(idx)
64-
self.assertTrue(name in frame.GetDisplayFunctionName())
64+
self.assertIn(name, frame.GetDisplayFunctionName())
6565
self.assertEqual(frame.IsArtificial(), is_artificial)

lldb/test/API/functionalities/tail_call_frames/cross_object/TestCrossObjectTailCalls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,5 @@ def test_cross_object_tail_calls(self):
5656
]
5757
for idx, (name, is_artificial) in enumerate(expected_frames):
5858
frame = thread.GetFrameAtIndex(idx)
59-
self.assertTrue(name in frame.GetDisplayFunctionName())
59+
self.assertIn(name, frame.GetDisplayFunctionName())
6060
self.assertEqual(frame.IsArtificial(), is_artificial)

lldb/test/API/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,5 @@ def do_test(self):
6161
# platform-dependent. E.g we see "void sink(void)" on Windows, but
6262
# "sink()" on Darwin. This seems like a bug -- just work around it
6363
# for now.
64-
self.assertTrue(name in frame.GetDisplayFunctionName())
64+
self.assertIn(name, frame.GetDisplayFunctionName())
6565
self.assertEqual(frame.IsArtificial(), is_artificial)

lldb/test/API/functionalities/tsan/basic/TestTsanBasic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def tsan_tests(self):
6363
process = self.dbg.GetSelectedTarget().process
6464
thread = process.GetSelectedThread()
6565
frame = thread.GetSelectedFrame()
66-
self.assertTrue("__tsan_on_report" in frame.GetFunctionName())
66+
self.assertIn("__tsan_on_report", frame.GetFunctionName())
6767

6868
# The stopped thread backtrace should contain either line1 or line2
6969
# from main.c.

lldb/test/API/functionalities/ubsan/basic/TestUbsanBasic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def ubsan_tests(self):
5151
substrs=['1 match found'])
5252

5353
# We should be stopped in __ubsan_on_report
54-
self.assertTrue("__ubsan_on_report" in frame.GetFunctionName())
54+
self.assertIn("__ubsan_on_report", frame.GetFunctionName())
5555

5656
# The stopped thread backtrace should contain either 'align line'
5757
found = False

lldb/test/API/lang/c/vla/TestVLA.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def test_variable_list(self):
2424
var_opts.SetUseDynamic(lldb.eDynamicCanRunTarget)
2525
all_locals = self.frame().GetVariables(var_opts)
2626
for value in all_locals:
27-
self.assertFalse("vla_expr" in value.name)
27+
self.assertNotIn("vla_expr", value.name)
2828

2929
@decorators.skipIf(compiler="clang", compiler_version=['<', '8.0'])
3030
def test_vla(self):

lldb/test/API/lang/cpp/accelerator-table/TestCPPAccelerator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def test(self):
2929
n = 0
3030
for line in log:
3131
if re.findall(r'[abcdefg]\.o: FindByNameAndTag\(\)', line):
32-
self.assertTrue("d.o" in line)
32+
self.assertIn("d.o", line)
3333
n += 1
3434

3535
self.assertEqual(n, 1, log)

lldb/test/API/lang/cpp/class_static/TestStaticVariables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def test_with_python_api(self):
138138
for val in valList:
139139
self.DebugSBValue(val)
140140
name = val.GetName()
141-
self.assertTrue(name in ['g_points', 'A::g_points'])
141+
self.assertIn(name, ['g_points', 'A::g_points'])
142142
if name == 'g_points':
143143
self.assertEqual(
144144
val.GetValueType(), lldb.eValueTypeVariableStatic)

lldb/test/API/lang/cpp/class_types/TestClassTypes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,5 +220,5 @@ def test_with_constructor_name(self):
220220
frame = thread.frames[0]
221221
self.assertTrue(frame.IsValid(), "Got a valid frame.")
222222

223-
self.assertTrue("C::C" in frame.name,
224-
"Constructor name includes class name.")
223+
self.assertIn("C::C", frame.name,
224+
"Constructor name includes class name.")

lldb/test/API/lang/objc/direct-dispatch-step/TestObjCDirectDispatchStepping.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def test_with_python_api(self):
3636
for idx in range(2,16):
3737
thread.StepInto()
3838
func_name = thread.GetFrameAtIndex(0).GetFunctionName()
39-
self.assertTrue("OverridesALot" in func_name, "%d'th step did not match name: %s"%(idx, func_name))
39+
self.assertIn("OverridesALot", func_name, "%d'th step did not match name: %s"%(idx, func_name))
4040
stop_threads = lldbutil.continue_to_breakpoint(process, stop_bkpt)
4141
self.assertEqual(len(stop_threads), 1)
4242
self.assertEqual(stop_threads[0], thread)

lldb/test/API/lang/objc/exceptions/TestObjCExceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def test_objc_exceptions_at_throw(self):
123123
pcs = [i.unsigned for i in children]
124124
names = [target.ResolveSymbolContextForAddress(lldb.SBAddress(pc, target), lldb.eSymbolContextSymbol).GetSymbol().name for pc in pcs]
125125
for n in ["objc_exception_throw", "foo(int)", "main"]:
126-
self.assertTrue(n in names, "%s is in the exception backtrace (%s)" % (n, names))
126+
self.assertIn(n, names, "%s is in the exception backtrace (%s)" % (n, names))
127127

128128
def test_objc_exceptions_at_abort(self):
129129
self.build()

lldb/test/API/lang/objc/objc-checker/TestObjCCheckers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def test_objc_checker(self):
7373

7474
# Make sure the error is helpful:
7575
err_string = expr_error.GetCString()
76-
self.assertTrue("selector" in err_string)
76+
self.assertIn("selector", err_string)
7777

7878
#
7979
# Check that we correctly insert the checker for an

lldb/test/API/macosx/macCatalyst/TestMacCatalyst.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def test_macabi(self):
3131
def check_debugserver(self, log):
3232
"""scan the debugserver packet log"""
3333
process_info = lldbutil.packetlog_get_process_info(log)
34-
self.assertTrue('ostype' in process_info)
34+
self.assertIn('ostype', process_info)
3535
self.assertEquals(process_info['ostype'], 'maccatalyst')
3636

3737
aout_info = None

lldb/test/API/macosx/macCatalystAppMacOSFramework/TestMacCatalystAppWithMacOSFramework.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test(self):
3434
def check_debugserver(self, log):
3535
"""scan the debugserver packet log"""
3636
process_info = lldbutil.packetlog_get_process_info(log)
37-
self.assertTrue('ostype' in process_info)
37+
self.assertIn('ostype', process_info)
3838
self.assertEquals(process_info['ostype'], 'maccatalyst')
3939

4040
aout_info = None

lldb/test/API/macosx/simulator/TestSimulatorPlatform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def check_load_commands(self, expected_load_command):
2929
def check_debugserver(self, log, expected_platform, expected_version):
3030
"""scan the debugserver packet log"""
3131
process_info = lldbutil.packetlog_get_process_info(log)
32-
self.assertTrue('ostype' in process_info)
32+
self.assertIn('ostype', process_info)
3333
self.assertEquals(process_info['ostype'], expected_platform)
3434
dylib_info = lldbutil.packetlog_get_dylib_info(log)
3535
self.assertTrue(dylib_info)

lldb/test/API/tools/lldb-server/TestGdbRemoteAuxvSupport.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def get_raw_auxv_data(self):
3535

3636
proc_info = self.parse_process_info_response(context)
3737
self.assertIsNotNone(proc_info)
38-
self.assertTrue("ptrsize" in proc_info)
38+
self.assertIn("ptrsize", proc_info)
3939
word_size = int(proc_info["ptrsize"])
4040

4141
OFFSET = 0

lldb/test/API/tools/lldb-server/TestGdbRemoteExpeditedRegisters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def stop_notification_contains_generic_register(
5454
self.assertIsNotNone(reg_info)
5555

5656
# Ensure the expedited registers contained it.
57-
self.assertTrue(reg_info["lldb_register_index"] in expedited_registers)
57+
self.assertIn(reg_info["lldb_register_index"], expedited_registers)
5858
self.trace("{} reg_info:{}".format(generic_register_name, reg_info))
5959

6060
def test_stop_notification_contains_any_registers(self):
@@ -121,5 +121,5 @@ def test_stop_notification_contains_vg_register(self):
121121
self.assertIsNotNone(reg_info)
122122

123123
# Ensure the expedited registers contained it.
124-
self.assertTrue(reg_info["lldb_register_index"] in expedited_registers)
124+
self.assertIn(reg_info["lldb_register_index"], expedited_registers)
125125
self.trace("{} reg_info:{}".format('vg', reg_info))

lldb/test/API/tools/lldb-server/TestGdbRemoteHostInfo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ def parse_host_info_response(self, context):
6666

6767
# Validate keys are known.
6868
for (key, val) in list(host_info_dict.items()):
69-
self.assertTrue(key in self.KNOWN_HOST_INFO_KEYS,
70-
"unknown qHostInfo key: " + key)
69+
self.assertIn(key, self.KNOWN_HOST_INFO_KEYS,
70+
"unknown qHostInfo key: " + key)
7171
self.assertIsNotNone(val)
7272

7373
# Return the key:val pairs.

lldb/test/API/tools/lldb-server/TestGdbRemote_vCont.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def vCont_supports_mode(self, mode, inferior_args=None):
2222
self.assertIsNotNone(supported_vCont_modes)
2323

2424
# Verify we support the given mode.
25-
self.assertTrue(mode in supported_vCont_modes)
25+
self.assertIn(mode, supported_vCont_modes)
2626

2727

2828
def test_vCont_supports_c(self):

0 commit comments

Comments
 (0)