Skip to content

Commit 7c7b1b1

Browse files
keitherskinemkleehammer
authored andcommitted
move travis code to correct func
1 parent 52cf4d0 commit 7c7b1b1

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

tests3/pgtests.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,15 @@ def test_emoticons_as_literal(self):
622622

623623
result = self.cursor.execute("select s from t1").fetchone()[0]
624624

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)
626634

627635
def test_cursor_messages(self):
628636
"""
@@ -652,15 +660,6 @@ def test_cursor_messages(self):
652660
self.assertTrue(type(self.cursor.messages[0][1]) is str)
653661
self.assertEqual('[01000] (-1)', self.cursor.messages[0][0])
654662
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)
664663

665664
def test_output_conversion(self):
666665
# Note the use of SQL_WVARCHAR, not SQL_VARCHAR.

0 commit comments

Comments
 (0)