Skip to content

Unit Test Failure: AssertionError due to error message capitalization mismatch in test_prepare.py #12

@setoru

Description

@setoru

Description:
When executing the test case tests/test_prepare.py::TestPrepare::test_prepare_02, an AssertionError is thrown. The error occurs because the expected error message "Column "a" does not exist." does not match the actual error message "column "a" does not exist".

Logs:

async_gaussdb.exceptions.UndefinedColumnError: Column "a" does not exist.
During handling of the above exception, another exception occurred:
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_prepare.py", line 35, in test_prepare_02
    await self.con.prepare('SELECT a')
  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.failureException(msg)
AssertionError: "column "a" does not exist" does not match "Column "a" does not exist."

How to reproduce it:

pytest --durations=0 -s -v tests/test_prepare.py::TestPrepare::test_prepare_02

Expected Behavior
Test pass.

Actual Behavior
The test fails with an AssertionError due to a mismatch in the error message capitalization ("column" vs "Column").

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