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

Test Failure - various BSON tests with Jython 2.7

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.5
    • Affects Version/s: None
    • Component/s: Tests
    • Labels:
      None

      This failure is caused by Jython's output for the 'replace' and 'ignore' handlers differing from CPython / PyPy:

      ======================================================================
      FAIL: test_unicode_decode_error_handler (test.test_bson.TestCodecOptions)
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "test/test_bson.py", line 934, in test_unicode_decode_error_handler
          self.assertEqual(dec, {replaced_key: u"foobar"})
      AssertionError: {u'ke\ufffdr': u'foobar'} != {u'ke\ufffdstr': u'foobar'}
      - {u'ke\ufffdr': u'foobar'}
      + {u'ke\ufffdstr': u'foobar'}
      ?            ++
      

      This failure is caused by Jython not properly handling NaN payloads from struct.(un)pack:

      ======================================================================
      FAIL: test_double (test.test_bson_corpus.TestBSONCorpus)
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "test/test_bson_corpus.py", line 116, in run_test
          self.assertEqual(encode_bson(decode_bson(B)), cB)
      AssertionError: '\x10\x00\x00\x00\x01d\x00\x00\x00\x00\x00\x00\x00\xf8\x7f\x00' != '\x10\x00\x00\x00\x01d\x00\x12\x00\x00\x00\x00\x00\xf8\x7f\x00'
      

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            bernie@mongodb.com Bernie Hackett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: