Skip to content

[lldb] Fix bad method call in TestExprDiagnostics.py #120901

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

carlocab
Copy link
Member

Fixes

Traceback (most recent call last):
  File "/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 1770, in test_method
    return attrvalue(self)
           ^^^^^^^^^^^^^^^
  File "/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/lldb/test/API/commands/expression/diagnostics/TestExprDiagnostics.py", line 255, in test_command_expr_sbdata
    self.assertEquals(error.GetType(), lldb.eErrorTypeExpression)
    ^^^^^^^^^^^^^^^^^
AttributeError: 'ExprDiagnosticsTestCase' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

assertEqual is a method inherited from unittest.TestCase.

See #120784 and #120784 (comment)

Fixes

    Traceback (most recent call last):
      File "/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 1770, in test_method
        return attrvalue(self)
               ^^^^^^^^^^^^^^^
      File "/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/lldb/test/API/commands/expression/diagnostics/TestExprDiagnostics.py", line 255, in test_command_expr_sbdata
        self.assertEquals(error.GetType(), lldb.eErrorTypeExpression)
        ^^^^^^^^^^^^^^^^^
    AttributeError: 'ExprDiagnosticsTestCase' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

`assertEqual` is a method inherited from `unittest.TestCase`.

See llvm#120784 and llvm#120784 (comment)
@llvmbot
Copy link
Member

llvmbot commented Dec 22, 2024

@llvm/pr-subscribers-lldb

Author: Carlo Cabrera (carlocab)

Changes

Fixes

Traceback (most recent call last):
  File "/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 1770, in test_method
    return attrvalue(self)
           ^^^^^^^^^^^^^^^
  File "/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/lldb/test/API/commands/expression/diagnostics/TestExprDiagnostics.py", line 255, in test_command_expr_sbdata
    self.assertEquals(error.GetType(), lldb.eErrorTypeExpression)
    ^^^^^^^^^^^^^^^^^
AttributeError: 'ExprDiagnosticsTestCase' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

assertEqual is a method inherited from unittest.TestCase.

See #120784 and #120784 (comment)


Full diff: https://github.com/llvm/llvm-project/pull/120901.diff

1 Files Affected:

  • (modified) lldb/test/API/commands/expression/diagnostics/TestExprDiagnostics.py (+1-1)
diff --git a/lldb/test/API/commands/expression/diagnostics/TestExprDiagnostics.py b/lldb/test/API/commands/expression/diagnostics/TestExprDiagnostics.py
index 59e759352ce063..b476a807c6dc0e 100644
--- a/lldb/test/API/commands/expression/diagnostics/TestExprDiagnostics.py
+++ b/lldb/test/API/commands/expression/diagnostics/TestExprDiagnostics.py
@@ -252,7 +252,7 @@ def check_error(diags):
         value = frame.EvaluateExpression("a+b")
         error = value.GetError()
         self.assertTrue(error.Fail())
-        self.assertEquals(error.GetType(), lldb.eErrorTypeExpression)
+        self.assertEqual(error.GetType(), lldb.eErrorTypeExpression)
         data = error.GetErrorData()
         version = data.GetValueForKey("version")
         self.assertEqual(version.GetIntegerValue(), 1)

@carlocab
Copy link
Member Author

Merging now since this is relatively low-risk and should hopefully unbreak some buildbots.

@carlocab carlocab merged commit aca7a70 into llvm:main Dec 23, 2024
9 checks passed
@carlocab carlocab deleted the lldb-TestExprDiagnostics branch December 23, 2024 07:37
@carlocab
Copy link
Member Author

Seems to be good now: https://lab.llvm.org/buildbot/#/builders/195/builds/2748

@labath
Copy link
Collaborator

labath commented Dec 23, 2024

Thanks.

@adrian-prantl
Copy link
Collaborator

Thanks for fixing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants