Skip to content

Commit cfe8eac

Browse files
committed
Fix tests
1 parent 41b574a commit cfe8eac

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

tests/tz/test_timezone.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
import pendulum
55
from pendulum import timezone
6-
from pendulum.utils._compat import PY2
6+
from pendulum.utils._compat import PY36
77
from pendulum.tz import fixed_timezone
88
from pendulum.tz.exceptions import NonExistingTime, AmbiguousTime
99

1010
from ..conftest import assert_datetime
1111

1212

13-
@pytest.mark.skipif(PY2, reason='fold attribute only present in Python 3.6+')
13+
@pytest.mark.skipif(not PY36, reason='fold attribute only present in Python 3.6+')
1414
def test_basic_convert():
1515
dt = datetime(2016, 6, 1, 12, 34, 56, 123456, fold=1)
1616
tz = timezone('Europe/Paris')
@@ -28,7 +28,7 @@ def test_basic_convert():
2828
assert dt.tzinfo.dst(dt) == timedelta(seconds=3600)
2929

3030

31-
@pytest.mark.skipif(PY2, reason='fold attribute only present in Python 3.6+')
31+
@pytest.mark.skipif(not PY36, reason='fold attribute only present in Python 3.6+')
3232
def test_skipped_time_with_pre_rule():
3333
dt = datetime(2013, 3, 31, 2, 30, 45, 123456, fold=0)
3434
tz = timezone('Europe/Paris')
@@ -46,7 +46,7 @@ def test_skipped_time_with_pre_rule():
4646
assert dt.tzinfo.dst(dt) == timedelta()
4747

4848

49-
@pytest.mark.skipif(PY2, reason='fold attribute only present in Python 3.6+')
49+
@pytest.mark.skipif(not PY36, reason='fold attribute only present in Python 3.6+')
5050
def test_skipped_time_with_post_rule():
5151
dt = datetime(2013, 3, 31, 2, 30, 45, 123456, fold=1)
5252
tz = timezone('Europe/Paris')
@@ -105,7 +105,7 @@ def test_skipped_time_with_error():
105105
tz.convert(dt, dst_rule=pendulum.TRANSITION_ERROR)
106106

107107

108-
@pytest.mark.skipif(PY2, reason='fold attribute only present in Python 3.6+')
108+
@pytest.mark.skipif(not PY36, reason='fold attribute only present in Python 3.6+')
109109
def test_repeated_time():
110110
dt = datetime(2013, 10, 27, 2, 30, 45, 123456, fold=1)
111111
tz = timezone('Europe/Paris')
@@ -123,7 +123,7 @@ def test_repeated_time():
123123
assert dt.tzinfo.dst(dt) == timedelta()
124124

125125

126-
@pytest.mark.skipif(PY2, reason='fold attribute only present in Python 3.6+')
126+
@pytest.mark.skipif(not PY36, reason='fold attribute only present in Python 3.6+')
127127
def test_repeated_time_explicit_post_rule():
128128
dt = datetime(2013, 10, 27, 2, 30, 45, 123456)
129129
tz = timezone('Europe/Paris')
@@ -141,7 +141,7 @@ def test_repeated_time_explicit_post_rule():
141141
assert dt.tzinfo.dst(dt) == timedelta()
142142

143143

144-
@pytest.mark.skipif(PY2, reason='fold attribute only present in Python 3.6+')
144+
@pytest.mark.skipif(not PY36, reason='fold attribute only present in Python 3.6+')
145145
def test_repeated_time_pre_rule():
146146
dt = datetime(2013, 10, 27, 2, 30, 45, 123456, fold=0)
147147
tz = timezone('Europe/Paris')
@@ -159,7 +159,7 @@ def test_repeated_time_pre_rule():
159159
assert dt.tzinfo.dst(dt) == timedelta(seconds=3600)
160160

161161

162-
@pytest.mark.skipif(PY2, reason='Disambiguation is not available in Python 2.7')
162+
@pytest.mark.skipif(not PY36, reason='Disambiguation is not available in Python 2.7')
163163
def test_repeated_time_explicit_pre_rule():
164164
dt = datetime(2013, 10, 27, 2, 30, 45, 123456)
165165
tz = timezone('Europe/Paris')
@@ -335,7 +335,7 @@ def test_on_last_transition():
335335
assert dt.utcoffset().total_seconds() == 7200
336336

337337

338-
@pytest.mark.skipif(PY2, reason='fold attribute only present in Python 3.6+')
338+
@pytest.mark.skipif(not PY36, reason='fold attribute only present in Python 3.6+')
339339
def test_convert_fold_attribute_is_honored():
340340
tz = pendulum.timezone('US/Eastern')
341341
dt = datetime(2014, 11, 2, 1, 30)
@@ -347,7 +347,7 @@ def test_convert_fold_attribute_is_honored():
347347
assert new.strftime('%z') == '-0500'
348348

349349

350-
@pytest.mark.skipif(PY2, reason='fold attribute only present in Python 3.6+')
350+
@pytest.mark.skipif(not PY36, reason='fold attribute only present in Python 3.6+')
351351
def test_utcoffset_fold_attribute_is_honored():
352352
tz = pendulum.timezone('US/Eastern')
353353
dt = datetime(2014, 11, 2, 1, 30)
@@ -361,7 +361,7 @@ def test_utcoffset_fold_attribute_is_honored():
361361
assert offset.total_seconds() == -5 * 3600
362362

363363

364-
@pytest.mark.skipif(PY2, reason='fold attribute only present in Python 3.6+')
364+
@pytest.mark.skipif(not PY36, reason='fold attribute only present in Python 3.6+')
365365
def test_dst_fold_attribute_is_honored():
366366
tz = pendulum.timezone('US/Eastern')
367367
dt = datetime(2014, 11, 2, 1, 30)
@@ -375,7 +375,7 @@ def test_dst_fold_attribute_is_honored():
375375
assert offset.total_seconds() == 0
376376

377377

378-
@pytest.mark.skipif(PY2, reason='fold attribute only present in Python 3.6+')
378+
@pytest.mark.skipif(not PY36, reason='fold attribute only present in Python 3.6+')
379379
def test_tzname_fold_attribute_is_honored():
380380
tz = pendulum.timezone('US/Eastern')
381381
dt = datetime(2014, 11, 2, 1, 30)
@@ -389,7 +389,7 @@ def test_tzname_fold_attribute_is_honored():
389389
assert name == 'EST'
390390

391391

392-
@pytest.mark.skipif(PY2, reason='fold attribute only present in Python 3.6+')
392+
@pytest.mark.skipif(not PY36, reason='fold attribute only present in Python 3.6+')
393393
def test_constructor_fold_attribute_is_honored():
394394
tz = pendulum.timezone('US/Eastern')
395395
dt = datetime(2014, 11, 2, 1, 30, tzinfo=tz)
@@ -401,7 +401,7 @@ def test_constructor_fold_attribute_is_honored():
401401
assert dt.strftime('%z') == '-0500'
402402

403403

404-
@pytest.mark.skipif(PY2, reason='fold attribute only present in Python 3.6+')
404+
@pytest.mark.skipif(not PY36, reason='fold attribute only present in Python 3.6+')
405405
def test_convert_sets_fold_attribute_properly():
406406
tz = pendulum.timezone('US/Eastern')
407407

0 commit comments

Comments
 (0)