Skip to content

Commit

Permalink
move travis code to correct func
Browse files Browse the repository at this point in the history
  • Loading branch information
keitherskine authored and mkleehammer committed Jan 22, 2021
1 parent 52cf4d0 commit 7c7b1b1
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions tests3/pgtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,15 @@ def test_emoticons_as_literal(self):

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

self.assertEqual(result, v)
if os.getenv('CI') == 'true' and os.getenv('TRAVIS') == 'true':
# On the current Travis CI platform (i.e. Ubuntu), this test generates the wrong
# result, which appears to be a PostgreSQL issue. A bug report has been raised
# with PostgreSQL: https://www.postgresql.org/message-id/16469-11c82a64f17f51f4%40postgresql.org
# Nevertheless, the result is predictable so we will still test for that incorrect value.
# This ensures the build passes and if this behavior ever changes, we will know about it.
self.assertEqual(result, v.encode('utf-8').decode('latin-1'))
else:
self.assertEqual(result, v)

def test_cursor_messages(self):
"""
Expand Down Expand Up @@ -652,15 +660,6 @@ def test_cursor_messages(self):
self.assertTrue(type(self.cursor.messages[0][1]) is str)
self.assertEqual('[01000] (-1)', self.cursor.messages[0][0])
self.assertTrue(self.cursor.messages[0][1].endswith('hello world'))
if os.getenv('CI') == 'true' and os.getenv('TRAVIS') == 'true':
# On the current Travis CI platform (i.e. Ubuntu), this test generates the wrong
# result, which appears to be a PostgreSQL issue. A bug report has been raised
# with PostgreSQL: https://www.postgresql.org/message-id/16469-11c82a64f17f51f4%40postgresql.org
# Nevertheless, the result is predictable so we will still test for that incorrect value.
# This ensures the build passes and if this behavior ever changes, we will know about it.
self.assertEqual(result, v.encode('utf-8').decode('latin-1'))
else:
self.assertEqual(result, v)

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

0 comments on commit 7c7b1b1

Please sign in to comment.