Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-2987

Test failure - test_errors on PyPy 7.3.7 due to a unicode str repr change

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 4.0
    • 3.12.2, 3.13, 4.0
    • Tests
    • None

    Description

      The following tests fail on PyPy 7.3.7 due to a unicode str repr change:

      ======================================================================
      FAIL: test_unicode_strs_not_primary_error (test.test_errors.TestErrors)
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/Users/shane/git/mongo-python-driver/test/test_errors.py", line 68, in test_unicode_strs_not_primary_error
          self._test_unicode_strs(exc)
        File "/Users/shane/git/mongo-python-driver/test/test_errors.py", line 51, in _test_unicode_strs
          "'errmsg': 'unicode \\U0001f40d'}", str(exc))
      AssertionError: "unicode 🐍, full error: {'errmsg': 'unicode \\U0001f40d'}" != "unicode 🐍, full error: {'errmsg': 'unicode 🐍'}"
      - unicode 🐍, full error: {'errmsg': 'unicode \U0001f40d'}
      ?                                            ^^^^^^^^^^
      + unicode 🐍, full error: {'errmsg': 'unicode 🐍'}
      ?                                            ^
       
       
      ======================================================================
      FAIL: test_unicode_strs_operation_failure (test.test_errors.TestErrors)
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/Users/shane/git/mongo-python-driver/test/test_errors.py", line 63, in test_unicode_strs_operation_failure
          self._test_unicode_strs(exc)
        File "/Users/shane/git/mongo-python-driver/test/test_errors.py", line 51, in _test_unicode_strs
          "'errmsg': 'unicode \\U0001f40d'}", str(exc))
      AssertionError: "unicode 🐍, full error: {'errmsg': 'unicode \\U0001f40d'}" != "unicode 🐍, full error: {'errmsg': 'unicode 🐍'}"
      - unicode 🐍, full error: {'errmsg': 'unicode \U0001f40d'}
      ?                                            ^^^^^^^^^^
      + unicode 🐍, full error: {'errmsg': 'unicode 🐍'}
      ?                                            ^
      

      Fixed by: https://github.com/mongodb/mongo-python-driver/pull/770

      See also: https://github.com/10gen/mongo-python-toolchain/issues/26

      Attachments

        Activity

          People

            shane.harvey@mongodb.com Shane Harvey
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: