diff options
| author | Jonas Devlieghere <jonas@devlieghere.com> | 2023-05-25 08:48:57 -0700 |
|---|---|---|
| committer | Jonas Devlieghere <jonas@devlieghere.com> | 2023-05-25 12:54:09 -0700 |
| commit | 2238dcc39358353cac21df75c3c3286ab20b8f53 (patch) | |
| tree | 1bb7ec8d7405ccd7fdb5a8a78d0cf5ef40bcc963 /lldb/test/API/python_api/debugger/TestDebuggerAPI.py | |
| parent | daeee56798c51e8f007e8e8e6e677a420b14c9ef (diff) | |
[NFC][Py Reformat] Reformat python files in lldb
This is an ongoing series of commits that are reformatting our Python
code. Reformatting is done with `black` (23.1.0).
If you end up having problems merging this commit because you have made
changes to a python file, the best way to handle that is to run `git
checkout --ours <yourfile>` and then reformat it with black.
RFC: https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style
Differential revision: https://reviews.llvm.org/D151460
Diffstat (limited to 'lldb/test/API/python_api/debugger/TestDebuggerAPI.py')
| -rw-r--r-- | lldb/test/API/python_api/debugger/TestDebuggerAPI.py | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/lldb/test/API/python_api/debugger/TestDebuggerAPI.py b/lldb/test/API/python_api/debugger/TestDebuggerAPI.py index dcc8e2477468..0f440bd451dd 100644 --- a/lldb/test/API/python_api/debugger/TestDebuggerAPI.py +++ b/lldb/test/API/python_api/debugger/TestDebuggerAPI.py @@ -42,7 +42,7 @@ class DebuggerAPITestCase(TestBase): def test_debugger_internal_variables(self): """Ensure that SBDebugger reachs the same instance of properties - regardless CommandInterpreter's context initialization""" + regardless CommandInterpreter's context initialization""" self.build() exe = self.getBuildArtifact("a.out") @@ -54,8 +54,9 @@ class DebuggerAPITestCase(TestBase): def get_cache_line_size(): value_list = lldb.SBStringList() - value_list = self.dbg.GetInternalVariableValue(property_name, - self.dbg.GetInstanceName()) + value_list = self.dbg.GetInternalVariableValue( + property_name, self.dbg.GetInstanceName() + ) self.assertEqual(value_list.GetSize(), 1) try: @@ -76,11 +77,10 @@ class DebuggerAPITestCase(TestBase): # This should change the value of a process's local property. new_cache_line_size = global_cache_line_size + 512 - error = self.dbg.SetInternalVariable(property_name, - str(new_cache_line_size), - self.dbg.GetInstanceName()) - self.assertSuccess(error, - property_name + " value was changed successfully") + error = self.dbg.SetInternalVariable( + property_name, str(new_cache_line_size), self.dbg.GetInstanceName() + ) + self.assertSuccess(error, property_name + " value was changed successfully") # Check that it was set actually. self.assertEqual(get_cache_line_size(), new_cache_line_size) @@ -95,31 +95,30 @@ class DebuggerAPITestCase(TestBase): exe = self.getBuildArtifact("a.out") self.yaml2obj("elf.yaml", exe) error = lldb.SBError() - target1 = self.dbg.CreateTarget(exe, None, "remote-linux", - False, error) + target1 = self.dbg.CreateTarget(exe, None, "remote-linux", False, error) self.assertSuccess(error) platform1 = target1.GetPlatform() platform1.SetWorkingDirectory("/foo/bar") # Reuse a platform if it matches the currently selected one... - target2 = self.dbg.CreateTarget(exe, None, "remote-linux", - False, error) + target2 = self.dbg.CreateTarget(exe, None, "remote-linux", False, error) self.assertSuccess(error) platform2 = target2.GetPlatform() - self.assertTrue(platform2.GetWorkingDirectory().endswith("bar"), - platform2.GetWorkingDirectory()) + self.assertTrue( + platform2.GetWorkingDirectory().endswith("bar"), + platform2.GetWorkingDirectory(), + ) # ... but create a new one if it doesn't. self.dbg.SetSelectedPlatform(lldb.SBPlatform("remote-windows")) - target3 = self.dbg.CreateTarget(exe, None, "remote-linux", - False, error) + target3 = self.dbg.CreateTarget(exe, None, "remote-linux", False, error) self.assertSuccess(error) platform3 = target3.GetPlatform() self.assertIsNone(platform3.GetWorkingDirectory()) def test_CreateTarget_arch(self): exe = self.getBuildArtifact("a.out") - if lldbplatformutil.getHostPlatform() == 'linux': + if lldbplatformutil.getHostPlatform() == "linux": self.yaml2obj("macho.yaml", exe) arch = "x86_64-apple-macosx" expected_platform = "remote-macosx" @@ -144,11 +143,14 @@ class DebuggerAPITestCase(TestBase): self.assertSuccess(error) platform2 = target2.GetPlatform() self.assertEqual(platform2.GetName(), expected_platform) - self.assertTrue(platform2.GetWorkingDirectory().endswith("bar"), - platform2.GetWorkingDirectory()) + self.assertTrue( + platform2.GetWorkingDirectory().endswith("bar"), + platform2.GetWorkingDirectory(), + ) def test_SetDestroyCallback(self): destroy_dbg_id = None + def foo(dbg_id): # Need nonlocal to modify closure variable. nonlocal destroy_dbg_id @@ -158,4 +160,4 @@ class DebuggerAPITestCase(TestBase): original_dbg_id = self.dbg.GetID() self.dbg.Destroy(self.dbg) - self.assertEqual(destroy_dbg_id, original_dbg_id) + self.assertEqual(destroy_dbg_id, original_dbg_id) |
