-
Notifications
You must be signed in to change notification settings - Fork 197
Closed
Labels
Description
This was triggered by #150 (comment).
The Travis file guided me to running the tests locally on my Mac. For some reason, I didn't investigate why, some of the tests fail.
Regardless of what the outcome is here I suggest to have the Travis CI build also run on macOS.
pytest output: (click to expand)
/tmp/maya (patch-1) > pipenv run pytest tests/
==================================================================== test session starts =====================================================================
platform darwin -- Python 3.6.5, pytest-3.5.1, py-1.5.3, pluggy-0.6.0
rootdir: /private/tmp/maya, inifile:
collected 264 items
tests/test_maya.py FF.....................F........................F....FFF..FF....................................................................... [ 49%]
...................................................... [ 70%]
tests/test_maya_interval.py ..............................................................................F [100%]
========================================================================== FAILURES ==========================================================================
_______________________________________________ test_rfc2822[February 21, 1994-Mon, 21 Feb 1994 00:00:00 GMT] ________________________________________________
string = 'February 21, 1994', expected = 'Mon, 21 Feb 1994 00:00:00 GMT'
@pytest.mark.parametrize("string,expected", [
('February 21, 1994',
'Mon, 21 Feb 1994 00:00:00 GMT'),
])
def test_rfc2822(string, expected):
> r = maya.parse(string).rfc2822()
tests/test_maya.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
maya/core.py:731: in parse
dt = pendulum.parse(str(string), **options)
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parser.py:20: in parse
return _parse(text, **options)
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parser.py:36: in _parse
parsed = base_parse(text, **options)
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parsing/__init__.py:64: in parse
return _normalize(_parse(text, **_options), **_options)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
text = 'February 21, 1994', options = {'day_first': False, 'exact': False, 'now': None, 'strict': True, ...}
def _parse(text, **options):
# Trying to parse ISO8601
try:
return parse_iso8601(text)
except ValueError:
pass
try:
return _parse_iso8601_interval(text)
except ValueError:
pass
try:
return _parse_common(text, **options)
except ParserError:
pass
# We couldn't parse the string
# so we fallback on the dateutil parser
# If not strict
if options.get('strict', True):
> raise ParserError('Unable to parse string [{}]'.format(text))
E pendulum.parsing.exceptions.ParserError: Unable to parse string [February 21, 1994]
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parsing/__init__.py:116: ParserError
____________________________________________________ test_iso8601[February 21, 1994-1994-02-21T00:00:00Z] ____________________________________________________
string = 'February 21, 1994', expected = '1994-02-21T00:00:00Z'
@pytest.mark.parametrize("string,expected", [
('February 21, 1994',
'1994-02-21T00:00:00Z'),
])
def test_iso8601(string, expected):
> r = maya.parse(string).iso8601()
tests/test_maya.py:29:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
maya/core.py:731: in parse
dt = pendulum.parse(str(string), **options)
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parser.py:20: in parse
return _parse(text, **options)
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parser.py:36: in _parse
parsed = base_parse(text, **options)
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parsing/__init__.py:64: in parse
return _normalize(_parse(text, **_options), **_options)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
text = 'February 21, 1994', options = {'day_first': False, 'exact': False, 'now': None, 'strict': True, ...}
def _parse(text, **options):
# Trying to parse ISO8601
try:
return parse_iso8601(text)
except ValueError:
pass
try:
return _parse_iso8601_interval(text)
except ValueError:
pass
try:
return _parse_common(text, **options)
except ParserError:
pass
# We couldn't parse the string
# so we fallback on the dateutil parser
# If not strict
if options.get('strict', True):
> raise ParserError('Unable to parse string [{}]'.format(text))
E pendulum.parsing.exceptions.ParserError: Unable to parse string [February 21, 1994]
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parsing/__init__.py:116: ParserError
_____________________________________________________________________ test_machine_parse _____________________________________________________________________
def test_machine_parse():
> r1 = maya.parse('August 14, 2015')
tests/test_maya.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
maya/core.py:731: in parse
dt = pendulum.parse(str(string), **options)
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parser.py:20: in parse
return _parse(text, **options)
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parser.py:36: in _parse
parsed = base_parse(text, **options)
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parsing/__init__.py:64: in parse
return _normalize(_parse(text, **_options), **_options)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
text = 'August 14, 2015', options = {'day_first': False, 'exact': False, 'now': None, 'strict': True, ...}
def _parse(text, **options):
# Trying to parse ISO8601
try:
return parse_iso8601(text)
except ValueError:
pass
try:
return _parse_iso8601_interval(text)
except ValueError:
pass
try:
return _parse_common(text, **options)
except ParserError:
pass
# We couldn't parse the string
# so we fallback on the dateutil parser
# If not strict
if options.get('strict', True):
> raise ParserError('Unable to parse string [{}]'.format(text))
E pendulum.parsing.exceptions.ParserError: Unable to parse string [August 14, 2015]
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parsing/__init__.py:116: ParserError
______________________________________________________________________ test_random_date ______________________________________________________________________
def test_random_date():
# Test properties for maya.when()
d1 = maya.when('11-17-11 08:09:10')
assert d1.year == 2011
assert d1.month == 11
assert d1.day == 17
assert d1.week == 46
assert d1.weekday == 4
assert d1.hour == 8
assert d1.minute == 9
assert d1.second == 10
assert d1.microsecond == 0
# Test properties for maya.parse()
> d2 = maya.parse('February 29, 1992 13:12:34')
tests/test_maya.py:131:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
maya/core.py:731: in parse
dt = pendulum.parse(str(string), **options)
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parser.py:20: in parse
return _parse(text, **options)
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parser.py:36: in _parse
parsed = base_parse(text, **options)
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parsing/__init__.py:64: in parse
return _normalize(_parse(text, **_options), **_options)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
text = 'February 29, 1992 13:12:34', options = {'day_first': False, 'exact': False, 'now': None, 'strict': True, ...}
def _parse(text, **options):
# Trying to parse ISO8601
try:
return parse_iso8601(text)
except ValueError:
pass
try:
return _parse_iso8601_interval(text)
except ValueError:
pass
try:
return _parse_common(text, **options)
except ParserError:
pass
# We couldn't parse the string
# so we fallback on the dateutil parser
# If not strict
if options.get('strict', True):
> raise ParserError('Unable to parse string [{}]'.format(text))
E pendulum.parsing.exceptions.ParserError: Unable to parse string [February 29, 1992 13:12:34]
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parsing/__init__.py:116: ParserError
_______________________________________________ test_parse[February 21, 1994-kwds0-1994-02-21 00:00:00+00:00] ________________________________________________
string = 'February 21, 1994', kwds = {}, expected = '1994-02-21 00:00:00+00:00'
@pytest.mark.parametrize("string,kwds,expected", [
('February 21, 1994', {},
'1994-02-21 00:00:00+00:00'),
('01/05/2016', {},
'2016-01-05 00:00:00+00:00'),
('01/05/2016', dict(day_first=True),
'2016-05-01 00:00:00+00:00'),
('2016/05/01', dict(year_first=True, day_first=False),
'2016-05-01 00:00:00+00:00'),
('2016/01/05', dict(year_first=True, day_first=True),
'2016-05-01 00:00:00+00:00'),
('01/05/2016', dict(timezone='UTC'),
'2016-01-05 00:00:00+00:00'),
('01/05/2016', dict(timezone='US/Central'),
'2016-01-05 06:00:00+00:00'),
])
def test_parse(string, kwds, expected):
> d = maya.parse(string, **kwds)
tests/test_maya.py:189:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
maya/core.py:731: in parse
dt = pendulum.parse(str(string), **options)
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parser.py:20: in parse
return _parse(text, **options)
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parser.py:36: in _parse
parsed = base_parse(text, **options)
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parsing/__init__.py:64: in parse
return _normalize(_parse(text, **_options), **_options)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
text = 'February 21, 1994', options = {'day_first': False, 'exact': False, 'now': None, 'strict': True, ...}
def _parse(text, **options):
# Trying to parse ISO8601
try:
return parse_iso8601(text)
except ValueError:
pass
try:
return _parse_iso8601_interval(text)
except ValueError:
pass
try:
return _parse_common(text, **options)
except ParserError:
pass
# We couldn't parse the string
# so we fallback on the dateutil parser
# If not strict
if options.get('strict', True):
> raise ParserError('Unable to parse string [{}]'.format(text))
E pendulum.parsing.exceptions.ParserError: Unable to parse string [February 21, 1994]
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parsing/__init__.py:116: ParserError
___________________________________________________ test_parse[01/05/2016-kwds1-2016-01-05 00:00:00+00:00] ___________________________________________________
string = '01/05/2016', kwds = {}, expected = '2016-01-05 00:00:00+00:00'
@pytest.mark.parametrize("string,kwds,expected", [
('February 21, 1994', {},
'1994-02-21 00:00:00+00:00'),
('01/05/2016', {},
'2016-01-05 00:00:00+00:00'),
('01/05/2016', dict(day_first=True),
'2016-05-01 00:00:00+00:00'),
('2016/05/01', dict(year_first=True, day_first=False),
'2016-05-01 00:00:00+00:00'),
('2016/01/05', dict(year_first=True, day_first=True),
'2016-05-01 00:00:00+00:00'),
('01/05/2016', dict(timezone='UTC'),
'2016-01-05 00:00:00+00:00'),
('01/05/2016', dict(timezone='US/Central'),
'2016-01-05 06:00:00+00:00'),
])
def test_parse(string, kwds, expected):
> d = maya.parse(string, **kwds)
tests/test_maya.py:189:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
maya/core.py:731: in parse
dt = pendulum.parse(str(string), **options)
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parser.py:20: in parse
return _parse(text, **options)
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parser.py:36: in _parse
parsed = base_parse(text, **options)
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parsing/__init__.py:64: in parse
return _normalize(_parse(text, **_options), **_options)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
text = '01/05/2016', options = {'day_first': False, 'exact': False, 'now': None, 'strict': True, ...}
def _parse(text, **options):
# Trying to parse ISO8601
try:
return parse_iso8601(text)
except ValueError:
pass
try:
return _parse_iso8601_interval(text)
except ValueError:
pass
try:
return _parse_common(text, **options)
except ParserError:
pass
# We couldn't parse the string
# so we fallback on the dateutil parser
# If not strict
if options.get('strict', True):
> raise ParserError('Unable to parse string [{}]'.format(text))
E pendulum.parsing.exceptions.ParserError: Unable to parse string [01/05/2016]
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parsing/__init__.py:116: ParserError
___________________________________________________ test_parse[01/05/2016-kwds2-2016-05-01 00:00:00+00:00] ___________________________________________________
string = '01/05/2016', kwds = {'day_first': True}, expected = '2016-05-01 00:00:00+00:00'
@pytest.mark.parametrize("string,kwds,expected", [
('February 21, 1994', {},
'1994-02-21 00:00:00+00:00'),
('01/05/2016', {},
'2016-01-05 00:00:00+00:00'),
('01/05/2016', dict(day_first=True),
'2016-05-01 00:00:00+00:00'),
('2016/05/01', dict(year_first=True, day_first=False),
'2016-05-01 00:00:00+00:00'),
('2016/01/05', dict(year_first=True, day_first=True),
'2016-05-01 00:00:00+00:00'),
('01/05/2016', dict(timezone='UTC'),
'2016-01-05 00:00:00+00:00'),
('01/05/2016', dict(timezone='US/Central'),
'2016-01-05 06:00:00+00:00'),
])
def test_parse(string, kwds, expected):
> d = maya.parse(string, **kwds)
tests/test_maya.py:189:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
maya/core.py:731: in parse
dt = pendulum.parse(str(string), **options)
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parser.py:20: in parse
return _parse(text, **options)
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parser.py:36: in _parse
parsed = base_parse(text, **options)
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parsing/__init__.py:64: in parse
return _normalize(_parse(text, **_options), **_options)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
text = '01/05/2016', options = {'day_first': True, 'exact': False, 'now': None, 'strict': True, ...}
def _parse(text, **options):
# Trying to parse ISO8601
try:
return parse_iso8601(text)
except ValueError:
pass
try:
return _parse_iso8601_interval(text)
except ValueError:
pass
try:
return _parse_common(text, **options)
except ParserError:
pass
# We couldn't parse the string
# so we fallback on the dateutil parser
# If not strict
if options.get('strict', True):
> raise ParserError('Unable to parse string [{}]'.format(text))
E pendulum.parsing.exceptions.ParserError: Unable to parse string [01/05/2016]
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parsing/__init__.py:116: ParserError
___________________________________________________ test_parse[01/05/2016-kwds5-2016-01-05 00:00:00+00:00] ___________________________________________________
string = '01/05/2016', kwds = {'timezone': 'UTC'}, expected = '2016-01-05 00:00:00+00:00'
@pytest.mark.parametrize("string,kwds,expected", [
('February 21, 1994', {},
'1994-02-21 00:00:00+00:00'),
('01/05/2016', {},
'2016-01-05 00:00:00+00:00'),
('01/05/2016', dict(day_first=True),
'2016-05-01 00:00:00+00:00'),
('2016/05/01', dict(year_first=True, day_first=False),
'2016-05-01 00:00:00+00:00'),
('2016/01/05', dict(year_first=True, day_first=True),
'2016-05-01 00:00:00+00:00'),
('01/05/2016', dict(timezone='UTC'),
'2016-01-05 00:00:00+00:00'),
('01/05/2016', dict(timezone='US/Central'),
'2016-01-05 06:00:00+00:00'),
])
def test_parse(string, kwds, expected):
> d = maya.parse(string, **kwds)
tests/test_maya.py:189:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
maya/core.py:731: in parse
dt = pendulum.parse(str(string), **options)
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parser.py:20: in parse
return _parse(text, **options)
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parser.py:36: in _parse
parsed = base_parse(text, **options)
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parsing/__init__.py:64: in parse
return _normalize(_parse(text, **_options), **_options)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
text = '01/05/2016', options = {'day_first': False, 'exact': False, 'now': None, 'strict': True, ...}
def _parse(text, **options):
# Trying to parse ISO8601
try:
return parse_iso8601(text)
except ValueError:
pass
try:
return _parse_iso8601_interval(text)
except ValueError:
pass
try:
return _parse_common(text, **options)
except ParserError:
pass
# We couldn't parse the string
# so we fallback on the dateutil parser
# If not strict
if options.get('strict', True):
> raise ParserError('Unable to parse string [{}]'.format(text))
E pendulum.parsing.exceptions.ParserError: Unable to parse string [01/05/2016]
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parsing/__init__.py:116: ParserError
___________________________________________________ test_parse[01/05/2016-kwds6-2016-01-05 06:00:00+00:00] ___________________________________________________
string = '01/05/2016', kwds = {'timezone': 'US/Central'}, expected = '2016-01-05 06:00:00+00:00'
@pytest.mark.parametrize("string,kwds,expected", [
('February 21, 1994', {},
'1994-02-21 00:00:00+00:00'),
('01/05/2016', {},
'2016-01-05 00:00:00+00:00'),
('01/05/2016', dict(day_first=True),
'2016-05-01 00:00:00+00:00'),
('2016/05/01', dict(year_first=True, day_first=False),
'2016-05-01 00:00:00+00:00'),
('2016/01/05', dict(year_first=True, day_first=True),
'2016-05-01 00:00:00+00:00'),
('01/05/2016', dict(timezone='UTC'),
'2016-01-05 00:00:00+00:00'),
('01/05/2016', dict(timezone='US/Central'),
'2016-01-05 06:00:00+00:00'),
])
def test_parse(string, kwds, expected):
> d = maya.parse(string, **kwds)
tests/test_maya.py:189:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
maya/core.py:731: in parse
dt = pendulum.parse(str(string), **options)
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parser.py:20: in parse
return _parse(text, **options)
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parser.py:36: in _parse
parsed = base_parse(text, **options)
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parsing/__init__.py:64: in parse
return _normalize(_parse(text, **_options), **_options)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
text = '01/05/2016', options = {'day_first': False, 'exact': False, 'now': None, 'strict': True, ...}
def _parse(text, **options):
# Trying to parse ISO8601
try:
return parse_iso8601(text)
except ValueError:
pass
try:
return _parse_iso8601_interval(text)
except ValueError:
pass
try:
return _parse_common(text, **options)
except ParserError:
pass
# We couldn't parse the string
# so we fallback on the dateutil parser
# If not strict
if options.get('strict', True):
> raise ParserError('Unable to parse string [{}]'.format(text))
E pendulum.parsing.exceptions.ParserError: Unable to parse string [01/05/2016]
/Users/marcelstoer/.local/share/virtualenvs/maya-Q6lP7IS5/lib/python3.6/site-packages/pendulum/parsing/__init__.py:116: ParserError
____________________________________________________________ test_interval_from_iso8601_duration _____________________________________________________________
def test_interval_from_iso8601_duration():
interval = maya.MayaInterval.from_iso8601(
> "2018-03-18T14:27:18Z/P13DT13H48M9S"
)
tests/test_maya_interval.py:557:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
maya/core.py:466: in from_iso8601
end = parse(end)
maya/core.py:732: in parse
return MayaDT.from_datetime(dt)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <class 'maya.core.MayaDT'>, args = (Duration(weeks=1, days=6, hours=13, minutes=48, seconds=9),), kwargs = {}, type_ = <class 'datetime.datetime'>
arg = Duration(weeks=1, days=6, hours=13, minutes=48, seconds=9)
def wrapper(self, *args, **kwargs):
type_ = param_type or type(self)
for arg in args + tuple(kwargs.values()):
if not isinstance(arg, type_):
raise TypeError(
(
'Invalid Type: {}.{}() accepts only the '
'arguments of type "<{}>"'
).format(
type(self).__name__,
function.__name__,
> type_.__name__,
)
)
E TypeError: Invalid Type: type.from_datetime() accepts only the arguments of type "<datetime>"
maya/core.py:68: TypeError
=========================================================== 10 failed, 254 passed in 5.05 seconds ============================================================
/tmp/maya (patch-1) >