Compare commits

..

1 Commits

Author SHA1 Message Date
Timo Furrer f9d257876b Support PyPy 2018-05-10 11:59:34 +02:00
5 changed files with 5 additions and 31 deletions
+3
View File
@@ -3,6 +3,9 @@ python:
- "2.7"
- "3.6"
- "3.7-dev"
# Test PyPy versions because PyPy is awesome :)
- "pypy2.7"
- "pypy3.6"
matrix:
allow_failures:
-8
View File
@@ -257,14 +257,6 @@ class MayaDT(object):
dt = dt.replace(tzinfo=self._tz)
return dt
def local_datetime(self):
"""Returns a local timezone-aware datetime object
It's the same as:
mayaDt.datetime(to_timezone=mayaDt.local_timezone)
"""
return self.datetime(to_timezone=self.local_timezone, naive=False)
def iso8601(self):
"""Returns an ISO 8601 representation of the MayaDT."""
# Get a timezone-naive datetime.
+1
View File
@@ -98,6 +98,7 @@ setup(
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Libraries :: Python Modules'
),
cmdclass={
-22
View File
@@ -342,28 +342,6 @@ def test_core_local_timezone(monkeypatch):
assert mdt.local_timezone == 'UTC'
def test_getting_datetime_for_local_timezone(monkeypatch):
@property
def mock_local_tz(self):
class StaticTzInfo(object):
zone = 'Europe/Zurich'
def __repr__(self):
return "<StaticTzInfo 'Europe/Zurich'>"
return StaticTzInfo()
monkeypatch.setattr(maya.MayaDT, '_local_tz', mock_local_tz)
d = maya.parse('1994-02-21T12:00:00+05:30')
dt = pytz.timezone('Europe/Zurich').localize(
Datetime(1994, 2, 21, 7, 30))
assert d.local_datetime() == dt
@pytest.mark.parametrize("when_str,snap_str,expected_when", [
('Mon, 21 Feb 1994 21:21:42 GMT', '@d',
'Mon, 21 Feb 1994 00:00:00 GMT'),
+1 -1
View File
@@ -1,5 +1,5 @@
[tox]
envlist = py27, py34, py35, py36
envlist = py27, pypy, py34, py35, py36, pypy3
[testenv]
deps = pipenv