Skip to content

Commit 83337d9

Browse files
sfc-gh-stakedaankit-bhatnagar167
authored andcommitted
SNOW-57024: adjusted tests for PY2 and PY3.4
1 parent b3001bc commit 83337d9

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

test/test_converter.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import pytest
1010
import pytz
1111

12-
from snowflake.connector.compat import PY2, IS_WINDOWS
12+
from snowflake.connector.compat import PY2, PY34_EXACT, IS_WINDOWS
1313
from snowflake.connector.converter import (
1414
ZERO_EPOCH,
1515
_generate_tzinfo_from_tzoffset)
@@ -442,7 +442,11 @@ def test_franction_followed_by_year_format(conn_cnx):
442442
assert rec[0] == '05:34:56.123456 Jan 03, 2012'
443443

444444

445-
def test_fetch_fraction_001(conn_cnx):
445+
def test_fetch_fraction_timestamp(conn_cnx):
446+
"""
447+
Additional fetch timestamp tests. Mainly used for SnowSQL
448+
which converts to string representations.
449+
"""
446450
PST_TZ = "America/Los_Angeles"
447451

448452
converter_class = SnowflakeConverterSnowSQL
@@ -479,9 +483,11 @@ def test_fetch_fraction_001(conn_cnx):
479483
assert ret[2] == '1900-01-01 05:00:01.000000000 +0000'
480484
assert ret[3] == '1900-01-01 05:00:01.000000000'
481485
assert ret[4] == '1900-01-01 05:00:01.012000000 +0000'
482-
assert ret[5] == '1900-01-01 05:00:01.012000000'
486+
if not PY2 and not PY34_EXACT:
487+
assert ret[5] == '1900-01-01 05:00:01.012000000'
483488
assert ret[6] == '1900-01-01 05:00:00.012000000 +0000'
484-
assert ret[7] == '1900-01-01 05:00:00.012000000'
489+
if not PY2 and not PY34_EXACT:
490+
assert ret[7] == '1900-01-01 05:00:00.012000000'
485491
assert ret[8] == '2100-01-01 05:00:00.012000000 +0000'
486492
assert ret[9] == '2100-01-01 05:00:00.012000000'
487493
assert ret[10] == '1970-01-01 00:00:00.000000000 +0000'

0 commit comments

Comments
 (0)