@@ -622,7 +622,15 @@ def test_emoticons_as_literal(self):
622
622
623
623
result = self .cursor .execute ("select s from t1" ).fetchone ()[0 ]
624
624
625
- self .assertEqual (result , v )
625
+ if os .getenv ('CI' ) == 'true' and os .getenv ('TRAVIS' ) == 'true' :
626
+ # On the current Travis CI platform (i.e. Ubuntu), this test generates the wrong
627
+ # result, which appears to be a PostgreSQL issue. A bug report has been raised
628
+ # with PostgreSQL: https://www.postgresql.org/message-id/16469-11c82a64f17f51f4%40postgresql.org
629
+ # Nevertheless, the result is predictable so we will still test for that incorrect value.
630
+ # This ensures the build passes and if this behavior ever changes, we will know about it.
631
+ self .assertEqual (result , v .encode ('utf-8' ).decode ('latin-1' ))
632
+ else :
633
+ self .assertEqual (result , v )
626
634
627
635
def test_cursor_messages (self ):
628
636
"""
@@ -652,15 +660,6 @@ def test_cursor_messages(self):
652
660
self .assertTrue (type (self .cursor .messages [0 ][1 ]) is str )
653
661
self .assertEqual ('[01000] (-1)' , self .cursor .messages [0 ][0 ])
654
662
self .assertTrue (self .cursor .messages [0 ][1 ].endswith ('hello world' ))
655
- if os .getenv ('CI' ) == 'true' and os .getenv ('TRAVIS' ) == 'true' :
656
- # On the current Travis CI platform (i.e. Ubuntu), this test generates the wrong
657
- # result, which appears to be a PostgreSQL issue. A bug report has been raised
658
- # with PostgreSQL: https://www.postgresql.org/message-id/16469-11c82a64f17f51f4%40postgresql.org
659
- # Nevertheless, the result is predictable so we will still test for that incorrect value.
660
- # This ensures the build passes and if this behavior ever changes, we will know about it.
661
- self .assertEqual (result , v .encode ('utf-8' ).decode ('latin-1' ))
662
- else :
663
- self .assertEqual (result , v )
664
663
665
664
def test_output_conversion (self ):
666
665
# Note the use of SQL_WVARCHAR, not SQL_VARCHAR.
0 commit comments