Skip to content

Unit Test Failure: AssertionError in test_standard_codecs with Empty String Input #6

@setoru

Description

@setoru

Description:
When running the test case tests/test_codecs.py::TestCodecs::test_standard_codecs, an AssertionError occurs. The test expects an empty string '' but receives None when passing an empty string as input.

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_codecs.py", line 536, in test_standard_codecs
    self.assertEqual(result, outputval, err_msg)
  File "/usr/lib64/python3.9/unittest/case.py", line 837, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/usr/lib64/python3.9/unittest/case.py", line 830, in _baseAssertEqual
    raise self.failureException(msg)
AssertionError: None != '' : unexpected result for text when passing ''

How to reproduce it:

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

Expected Behavior
test pass.

Actual Behavior
The result is None instead of '', leading to an AssertionError.

Environment

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions