Skip to content

Unit Test Failure: AssertionError in test_execute.py for error messages #9

@setoru

Description

@setoru

Description:
When executing the test case tests/test_execute.py::TestExecuteScript::test_execute_exceptions_1, an AssertionError is thrown. The error occurs because the expected error message "relation "dne" does not exist" does not match the actual error message "Relation "dne" does not exist on dn_6001_6002_6003.".

Logs:

Traceback (most recent call last):
  File "/usr/lib64/python3.9/unittest/case.py", line 59, in testPartExecutor
    yield
  File "/usr/lib64/python3.9/unittest/case.py", line 592, in run
    self._callTestMethod(testMethod)
  File "/usr/lib64/python3.9/unittest/case.py", line 550, in _callTestMethod
    method()
  File "/home/gaussdbuser/gaussdb-python-async/.venv/lib64/python3.9/site-packages/async_gaussdb/_testbase/__init__.py", line 92, in wrapper
    self.loop.run_until_complete(coro)
  File "/usr/lib64/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/home/gaussdbuser/gaussdb-python-async/tests/test_execute.py", line 68, in test_execute_exceptions_1
    await execute('select * from __dne__')
  File "/usr/lib64/python3.9/unittest/case.py", line 239, in __exit__
    self._raiseFailure("{} does not match {}".format(
  File "/usr/lib64/python3.9/unittest/case.py", line 163, in _raiseFailure
    raise self.test_case.failureException(msg)
AssertionError: "relation "__dne__" does not exist" does not match "Relation "__dne__" does not exist on dn_6001_6002_6003."

How to reproduce it:

pytest --durations=0 -s -v tests/test_execute.py

Expected Behavior
Test assertion passes, meaning the expected and actual error messages match.

Actual Behavior
The test fails with an AssertionError due to a mismatch between the expected and actual "relation does not exist" error messages.

Environment

  • OS: Huawei Cloud EulerOS 2.0
  • Python Version: 3.9
  • Database: GaussDB Kernel 505.2.1.SPC0800 build 3e43b3bc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions