Skip to content

Instantly share code, notes, and snippets.

@stevenroose
Created July 18, 2017 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevenroose/f8ecf6cf843d2868aeba2f9aa2c13ce7 to your computer and use it in GitHub Desktop.
Save stevenroose/f8ecf6cf843d2868aeba2f9aa2c13ce7 to your computer and use it in GitHub Desktop.
==> Starting check()...
============================================ test session starts =============================================
platform linux -- Python 3.6.1, pytest-3.1.2, py-1.4.34, pluggy-0.4.0
rootdir: /home/steven/.cache/pacaur/todoman/src/todoman-3.2.0, inifile: setup.cfg
plugins: subtesthack-0.1.1, localserver-0.3.5, hypothesis-3.11.6
collected 155 items
tests/test_backend.py .......
tests/test_cli.py ........x.....F....F.....................F.....s......
tests/test_config.py .......xx......
tests/test_filtering.py .........
tests/test_formatter.py FFFF..........
tests/test_main.py .
tests/test_model.py ............................
tests/test_porcelain.py ........
tests/test_ui.py ..........
tests/test_widgets.py .........
================================================== FAILURES ==================================================
________________________________________________ test_dtstamp ________________________________________________
tmpdir = local('/tmp/pytest-of-steven/pytest-5/test_dtstamp0')
runner = <conftest.runner.<locals>.SleepyCliRunner object at 0x7f9db46d0f60>
create = <function create.<locals>.inner at 0x7f9dae83df28>
@freeze_time('2017-03-17 20:22:19')
def test_dtstamp(tmpdir, runner, create):
"""Test that we add the DTSTAMP to new entries as per RFC5545."""
result = runner.invoke(cli, ['new', '-l', 'default', 'test event'])
> assert not result.exception
E AssertionError: assert not InvalidArgsError(<class 'icu.SimpleDateFormat'>, 'format', (FakeDatetime(2003, 10, 30, 11, 45),))
E + where InvalidArgsError(<class 'icu.SimpleDateFormat'>, 'format', (FakeDatetime(2003, 10, 30, 11, 45),)) = <Result InvalidArgsError(<class 'icu.SimpleDateFormat'>, 'format', (FakeDatetime(2003, 10, 30, 11, 45),))>.exception
tests/test_cli.py:216: AssertionError
_____________________________________________ test_default_due2 ______________________________________________
tmpdir = local('/tmp/pytest-of-steven/pytest-5/test_default_due20')
runner = <conftest.runner.<locals>.SleepyCliRunner object at 0x7f9db4930a20>
create = <function create.<locals>.inner at 0x7f9daeab4488>
todos = <function todos.<locals>.inner at 0x7f9daeab4c80>
@freeze_time(datetime.datetime.now())
def test_default_due2(tmpdir, runner, create, todos):
cfg = tmpdir.join('config')
cfg.write('default_due = 24\n', 'a')
r = runner.invoke(cli, ['new', '-ldefault', '-dtomorrow', 'aaa'])
> assert not r.exception
E AssertionError: assert not InvalidArgsError(<class 'icu.SimpleDateFormat'>, 'format', (FakeDatetime(2003, 10, 30, 11, 45),))
E + where InvalidArgsError(<class 'icu.SimpleDateFormat'>, 'format', (FakeDatetime(2003, 10, 30, 11, 45),)) = <Result InvalidArgsError(<class 'icu.SimpleDateFormat'>, 'format', (FakeDatetime(2003, 10, 30, 11, 45),))>.exception
tests/test_cli.py:272: AssertionError
____________________________________________ test_list_startable _____________________________________________
tmpdir = local('/tmp/pytest-of-steven/pytest-5/test_list_startable0')
runner = <conftest.runner.<locals>.SleepyCliRunner object at 0x7f9db492b630>
todo_factory = <function todo_factory.<locals>.inner at 0x7f9daeab46a8>
@freeze_time('2017, 3, 20')
def test_list_startable(tmpdir, runner, todo_factory):
todo_factory(summary='started', start=datetime.datetime(2017, 3, 15))
todo_factory(summary='nostart')
todo_factory(summary='unstarted', start=datetime.datetime(2017, 3, 24))
result = runner.invoke(
cli,
['list', '--startable'],
> catch_exceptions=False,
)
tests/test_cli.py:668:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/conftest.py:45: in invoke
return super().invoke(*args, **kwargs)
/usr/lib/python3.6/site-packages/click/testing.py:279: in invoke
prog_name=self.get_default_prog_name(cli), **extra)
/usr/lib/python3.6/site-packages/click/core.py:697: in main
rv = self.invoke(ctx)
/usr/lib/python3.6/site-packages/click/core.py:1064: in invoke
sub_ctx = cmd.make_context(cmd_name, args, parent=ctx)
/usr/lib/python3.6/site-packages/click/core.py:621: in make_context
self.parse_args(ctx, args)
/usr/lib/python3.6/site-packages/click/core.py:880: in parse_args
value, args = param.handle_parse_result(ctx, opts, args)
/usr/lib/python3.6/site-packages/click/core.py:1404: in handle_parse_result
self.callback, ctx, self, value)
/usr/lib/python3.6/site-packages/click/core.py:78: in invoke_param_callback
return callback(ctx, param, value)
todoman/cli.py:76: in _validate_priority_param
return ctx.formatter.parse_priority(val)
todoman/model.py:58: in __get__
obj.__dict__[self.__name__] = result = self.fget(obj)
todoman/cli.py:182: in formatter
self.config['main']['dt_separator']
todoman/formatters.py:27: in __init__
self._parsedatetime_calendar = parsedatetime.Calendar()
/usr/lib/python3.6/site-packages/parsedatetime/__init__.py:271: in __init__
self.ptc = Constants()
/usr/lib/python3.6/site-packages/parsedatetime/__init__.py:2379: in __init__
self.locale = get_icu(self.localeID)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
locale = 'en_US'
def get_icu(locale):
from . import base
result = dict([(key, getattr(base, key))
for key in dir(base) if not key.startswith('_')])
result['icu'] = None
if pyicu is None:
return icu_object(result)
if locale is None:
locale = 'en_US'
result['icu'] = icu = pyicu.Locale(locale)
if icu is None:
return icu_object(result)
# grab spelled out format of all numbers from 0 to 100
rbnf = pyicu.RuleBasedNumberFormat(pyicu.URBNFRuleSetTag.SPELLOUT, icu)
result['numbers'].update([(rbnf.format(i), i) for i in range(0, 100)])
symbols = result['symbols'] = pyicu.DateFormatSymbols(icu)
# grab ICU list of weekdays, skipping first entry which
# is always blank
wd = [w.lower() for w in symbols.getWeekdays()[1:]]
swd = [sw.lower() for sw in symbols.getShortWeekdays()[1:]]
# store them in our list with Monday first (ICU puts Sunday first)
result['Weekdays'] = merge_weekdays(result['Weekdays'],
wd[1:] + wd[0:1])
result['shortWeekdays'] = merge_weekdays(result['shortWeekdays'],
swd[1:] + swd[0:1])
result['Months'] = [m.lower() for m in symbols.getMonths()]
result['shortMonths'] = [sm.lower() for sm in symbols.getShortMonths()]
keys = ['full', 'long', 'medium', 'short']
createDateInstance = pyicu.DateFormat.createDateInstance
createTimeInstance = pyicu.DateFormat.createTimeInstance
icu_df = result['icu_df'] = {
'full': createDateInstance(pyicu.DateFormat.kFull, icu),
'long': createDateInstance(pyicu.DateFormat.kLong, icu),
'medium': createDateInstance(pyicu.DateFormat.kMedium, icu),
'short': createDateInstance(pyicu.DateFormat.kShort, icu),
}
icu_tf = result['icu_tf'] = {
'full': createTimeInstance(pyicu.DateFormat.kFull, icu),
'long': createTimeInstance(pyicu.DateFormat.kLong, icu),
'medium': createTimeInstance(pyicu.DateFormat.kMedium, icu),
'short': createTimeInstance(pyicu.DateFormat.kShort, icu),
}
result['dateFormats'] = {}
result['timeFormats'] = {}
for x in keys:
result['dateFormats'][x] = icu_df[x].toPattern()
result['timeFormats'][x] = icu_tf[x].toPattern()
am = pm = ts = ''
# ICU doesn't seem to provide directly the date or time separator
# so we have to figure it out
o = result['icu_tf']['short']
s = result['timeFormats']['short']
result['usesMeridian'] = 'a' in s
result['uses24'] = 'H' in s
# '11:45 AM' or '11:45'
> s = o.format(datetime.datetime(2003, 10, 30, 11, 45))
E icu.InvalidArgsError: (<class 'icu.SimpleDateFormat'>, 'format', (FakeDatetime(2003, 10, 30, 11, 45),))
/usr/lib/python3.6/site-packages/parsedatetime/pdt_locales/icu.py:105: InvalidArgsError
_____________________________________ test_humanized_date[CET-interval0] _____________________________________
runner = <conftest.runner.<locals>.SleepyCliRunner object at 0x7f9dafd3f860>
create = <function create.<locals>.inner at 0x7f9dae6c3598>, interval = (65, 'in a minute')
now_for_tz = <function now_for_tz.<locals>.inner at 0x7f9dae83d400>, tz = 'CET'
@pytest.mark.parametrize('interval', [
(65, 'in a minute'),
(-10800, '3 hours ago'),
])
@pytest.mark.parametrize('tz', ['CET', 'HST'])
@freeze_time('2017-03-25')
def test_humanized_date(runner, create, interval, now_for_tz, tz):
seconds, expected = interval
due = now_for_tz(tz) + timedelta(seconds=seconds)
create(
'test.ics',
'SUMMARY:Hi human!\n'
'DUE;VALUE=DATE-TIME;TZID={}:{}\n'
.format(tz, due.strftime('%Y%m%dT%H%M%S'))
)
result = runner.invoke(cli, ['--humanize', 'list', '--status', 'ANY'])
> assert not result.exception
E AssertionError: assert not InvalidArgsError(<class 'icu.SimpleDateFormat'>, 'format', (FakeDatetime(2003, 10, 30, 11, 45),))
E + where InvalidArgsError(<class 'icu.SimpleDateFormat'>, 'format', (FakeDatetime(2003, 10, 30, 11, 45),)) = <Result InvalidArgsError(<class 'icu.SimpleDateFormat'>, 'format', (FakeDatetime(2003, 10, 30, 11, 45),))>.exception
tests/test_formatter.py:27: AssertionError
_____________________________________ test_humanized_date[CET-interval1] _____________________________________
runner = <conftest.runner.<locals>.SleepyCliRunner object at 0x7f9db46ba978>
create = <function create.<locals>.inner at 0x7f9dae83d840>, interval = (-10800, '3 hours ago')
now_for_tz = <function now_for_tz.<locals>.inner at 0x7f9dae83d488>, tz = 'CET'
@pytest.mark.parametrize('interval', [
(65, 'in a minute'),
(-10800, '3 hours ago'),
])
@pytest.mark.parametrize('tz', ['CET', 'HST'])
@freeze_time('2017-03-25')
def test_humanized_date(runner, create, interval, now_for_tz, tz):
seconds, expected = interval
due = now_for_tz(tz) + timedelta(seconds=seconds)
create(
'test.ics',
'SUMMARY:Hi human!\n'
'DUE;VALUE=DATE-TIME;TZID={}:{}\n'
.format(tz, due.strftime('%Y%m%dT%H%M%S'))
)
result = runner.invoke(cli, ['--humanize', 'list', '--status', 'ANY'])
> assert not result.exception
E AssertionError: assert not InvalidArgsError(<class 'icu.SimpleDateFormat'>, 'format', (FakeDatetime(2003, 10, 30, 11, 45),))
E + where InvalidArgsError(<class 'icu.SimpleDateFormat'>, 'format', (FakeDatetime(2003, 10, 30, 11, 45),)) = <Result InvalidArgsError(<class 'icu.SimpleDateFormat'>, 'format', (FakeDatetime(2003, 10, 30, 11, 45),))>.exception
tests/test_formatter.py:27: AssertionError
_____________________________________ test_humanized_date[HST-interval0] _____________________________________
runner = <conftest.runner.<locals>.SleepyCliRunner object at 0x7f9dae1a87b8>
create = <function create.<locals>.inner at 0x7f9dae6c38c8>, interval = (65, 'in a minute')
now_for_tz = <function now_for_tz.<locals>.inner at 0x7f9dae6c30d0>, tz = 'HST'
@pytest.mark.parametrize('interval', [
(65, 'in a minute'),
(-10800, '3 hours ago'),
])
@pytest.mark.parametrize('tz', ['CET', 'HST'])
@freeze_time('2017-03-25')
def test_humanized_date(runner, create, interval, now_for_tz, tz):
seconds, expected = interval
due = now_for_tz(tz) + timedelta(seconds=seconds)
create(
'test.ics',
'SUMMARY:Hi human!\n'
'DUE;VALUE=DATE-TIME;TZID={}:{}\n'
.format(tz, due.strftime('%Y%m%dT%H%M%S'))
)
result = runner.invoke(cli, ['--humanize', 'list', '--status', 'ANY'])
> assert not result.exception
E AssertionError: assert not InvalidArgsError(<class 'icu.SimpleDateFormat'>, 'format', (FakeDatetime(2003, 10, 30, 11, 45),))
E + where InvalidArgsError(<class 'icu.SimpleDateFormat'>, 'format', (FakeDatetime(2003, 10, 30, 11, 45),)) = <Result InvalidArgsError(<class 'icu.SimpleDateFormat'>, 'format', (FakeDatetime(2003, 10, 30, 11, 45),))>.exception
tests/test_formatter.py:27: AssertionError
_____________________________________ test_humanized_date[HST-interval1] _____________________________________
runner = <conftest.runner.<locals>.SleepyCliRunner object at 0x7f9dae1a8c50>
create = <function create.<locals>.inner at 0x7f9dae83da60>, interval = (-10800, '3 hours ago')
now_for_tz = <function now_for_tz.<locals>.inner at 0x7f9dae699e18>, tz = 'HST'
@pytest.mark.parametrize('interval', [
(65, 'in a minute'),
(-10800, '3 hours ago'),
])
@pytest.mark.parametrize('tz', ['CET', 'HST'])
@freeze_time('2017-03-25')
def test_humanized_date(runner, create, interval, now_for_tz, tz):
seconds, expected = interval
due = now_for_tz(tz) + timedelta(seconds=seconds)
create(
'test.ics',
'SUMMARY:Hi human!\n'
'DUE;VALUE=DATE-TIME;TZID={}:{}\n'
.format(tz, due.strftime('%Y%m%dT%H%M%S'))
)
result = runner.invoke(cli, ['--humanize', 'list', '--status', 'ANY'])
> assert not result.exception
E AssertionError: assert not InvalidArgsError(<class 'icu.SimpleDateFormat'>, 'format', (FakeDatetime(2003, 10, 30, 11, 45),))
E + where InvalidArgsError(<class 'icu.SimpleDateFormat'>, 'format', (FakeDatetime(2003, 10, 30, 11, 45),)) = <Result InvalidArgsError(<class 'icu.SimpleDateFormat'>, 'format', (FakeDatetime(2003, 10, 30, 11, 45),))>.exception
tests/test_formatter.py:27: AssertionError
============================================== warnings summary ==============================================
None
pytest_funcarg__httpserver: declaring fixtures using "pytest_funcarg__" prefix is deprecated and scheduled to be removed in pytest 4.0. Please remove the prefix and use the @pytest.fixture decorator instead.
pytest_funcarg__httpsserver: declaring fixtures using "pytest_funcarg__" prefix is deprecated and scheduled to be removed in pytest 4.0. Please remove the prefix and use the @pytest.fixture decorator instead.
pytest_funcarg__smtpserver: declaring fixtures using "pytest_funcarg__" prefix is deprecated and scheduled to be removed in pytest 4.0. Please remove the prefix and use the @pytest.fixture decorator instead.
-- Docs: http://doc.pytest.org/en/latest/warnings.html
================== 7 failed, 144 passed, 1 skipped, 3 xfailed, 3 warnings in 11.31 seconds ===================
==> ERROR: A failure occurred in check().
Aborting...
:: failed to build todoman package(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment