On Wed, Mar 13, 2019 at 09:56:23PM -0400, Kurt Mosiejczuk wrote:
> While looking into another port update, I came across productivity/khal
> that was temporarily not using PyPi until a new version had a fix for
> using py-dateutil >= 2.7. I checked, and such an update is out.
Thanks.
> So I converted the port back to using PyPi. While here, I fixed all the
> tests that would fail if/because LC_CTYPE=C.UTF-8 was not defined for
> the test environment. With that in place, only 4 of the tests fail and
> they are all the ones expecting us to print out different days of
> the week.
Looks good to me; OK kn. Two unrelated nits inline if you care to fix
them along the way.
FWIW, I see five not four tests failing: see my test.log below.
> cc maintainer jung@
Either you put him on Bcc or actually forgot the Cc, so I just added him
to the loop.
> MODPY_SETUPTOOLS = Yes
> MODPY_VERSION = ${MODPY_DEFAULT_VERSION_3}
Replace these ^^^^^^^^^ spaces with tabs.
> @@ -46,7 +39,10 @@ TEST_DEPENDS = ${RUN_DEPENDS} \
> devel/py-test-cov${MODPY_FLAVOR} \
> devel/py-freezegun${MODPY_FLAVOR}
Sort dependencies alphabetically.
cd /usr/ports/pobj/khal-0.9.10/khal-0.9.10 && exec /usr/bin/env -i CC=cc
PYTHONUSERBASE= PORTSDIR="/usr/ports" LIBTOOL="/usr/bin/libtool"
PATH='/usr/ports/pobj/khal-0.9.10/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11R6/bin'
PREFIX='/usr/local' LOCALBASE='/usr/local' X11BASE='/usr/X11R6' CFLAGS='-O2
-pipe' TRUEPREFIX='/usr/local' DESTDIR='' HOME='/khal-0.9.10_writes_to_HOME'
COMPILER_VERSION=clang PICFLAG="-fpic" BINGRP=bin BINOWN=root BINMODE=755
NONBINMODE=644 DIRMODE=755 INSTALL_COPY=-c INSTALL_STRIP=-s MANGRP=bin
MANOWN=root MANMODE=644
BSD_INSTALL_PROGRAM="/usr/ports/pobj/khal-0.9.10/bin/install -c -s -m 755"
BSD_INSTALL_SCRIPT="/usr/ports/pobj/khal-0.9.10/bin/install -c -m 755"
BSD_INSTALL_DATA="/usr/ports/pobj/khal-0.9.10/bin/install -c -m 644"
BSD_INSTALL_MAN="/usr/ports/pobj/khal-0.9.10/bin/install -c -m 644"
BSD_INSTALL_PROGRAM_DIR="/usr/ports/pobj/khal-0.9.10/bin/install -d -m 755"
BSD_INSTALL_SCRIPT_DIR="/usr/ports/pobj/khal-0.9.10/bin/install -d -m 755"
BSD_INSTALL_DATA_DIR="/usr/ports/pobj/khal-0.9.10/bin/install -d -m 755"
BSD_INSTALL_MAN_DIR="/usr/ports/pobj/khal-0.9.10/bin/install -d -m 755"
LC_CTYPE=C.UTF-8 /usr/local/bin/python3.6 -m pytest
============================= test session starts ==============================
platform openbsd6 -- Python 3.6.8, pytest-3.5.0, py-1.8.0, pluggy-0.6.0
rootdir: /usr/ports/pobj/khal-0.9.10/khal-0.9.10, inifile:
plugins: cov-2.5.1, hypothesis-3.55.1
collected 275 items
tests/backend_test.py .............................. [ 10%]
tests/cal_display_test.py ...FFFF [ 13%]
tests/cli_test.py ..............x....................... [ 27%]
tests/configwizard_test.py . [ 27%]
tests/controller_test.py ............ [ 32%]
tests/event_test.py ........................................... [ 47%]
tests/khalendar_test.py ....................... [ 56%]
tests/khalendar_utils_test.py ....................................... [ 70%]
tests/settings_test.py ........... [ 74%]
tests/terminal_test.py ... [ 75%]
tests/utils_test.py ..............................................F..... [ 94%]
.... [ 95%]
tests/vdir_test.py x.. [ 96%]
tests/vtimezone_test.py ... [ 97%]
tests/ui/test_calendarwidget.py ... [ 98%]
tests/ui/test_editor.py .. [ 99%]
tests/ui/test_widgets.py . [100%]
=================================== FAILURES ===================================
_________________________ test_vertical_month_unicode __________________________
def test_vertical_month_unicode():
try:
locale.setlocale(locale.LC_ALL, 'de_DE.UTF-8')
vert_str = vertical_month(month=12, year=2011,
today=datetime.date(2011, 12, 12))
# de_DE locale on at least Net and FreeBSD is different from the one
# commonly used on linux systems
if platform.system() == 'FreeBSD':
assert vert_str == example_de_freebsd
elif platform.system() == 'NetBSD':
assert vert_str == example_de_netbsd
else:
> assert vert_str == example_de
E AssertionError: assert ['\x1b[1m ... 31 1 ', ...] ==
['\x1b[1m M... 31 1 ', ...]
E At index 0 diff: '\x1b[1m Mo Tu We Th Fr Sa Su \x1b[0m' !=
'\x1b[1m Mo Di Mi Do Fr Sa So \x1b[0m'
E Use -v to get the full diff
tests/cal_display_test.py:234: AssertionError
____________________ test_vertical_month_unicode_weekdeays _____________________
def test_vertical_month_unicode_weekdeays():
try:
locale.setlocale(locale.LC_ALL, 'cs_CZ.UTF-8')
vert_str = vertical_month(month=12, year=2011,
today=datetime.date(2011, 12, 12))
> assert [line.lower() for line in vert_str] == [line.lower() for
> line in example_cz]
E AssertionError: assert ['\x1b[1m ... 31 1 ', ...] == ['\x1b[1m
p... 31 1 ', ...]
E At index 0 diff: '\x1b[1m mo tu we th fr sa su \x1b[0m' !=
'\x1b[1m po út st čt pá so ne \x1b[0m'
E Use -v to get the full diff
tests/cal_display_test.py:256: AssertionError
___________________ test_vertical_month_unicode_weekdeays_gr ___________________
def test_vertical_month_unicode_weekdeays_gr():
try:
locale.setlocale(locale.LC_ALL, 'el_GR.UTF-8')
vert_str = vertical_month(month=12, year=2011,
today=datetime.date(2011, 12, 12))
# on some OSes, Greek locale's abbreviated day of the week and
# month names have accents, on some they haven't
> assert strip_accents('\n'.join([line.lower() for line in
> vert_str])) == \
'\n'.join(example_gr)
E AssertionError: assert '\x1b[1m m... 1 2 3 4 ' ==
'\x1b[1m δ... 1 2 3 4 '
E - [1m mo tu we th fr sa su [0m
E + [1m δε τρ τε πε πα σα κυ [0m
E - [1mdec [0m28 29 30 1 2 3 4
E ? ^^^
E + [1mδεκ [0m28 29 30 1 2 3 4
E ? ^^^^
E - 5 6 7 8 9 10 11 ...
E
E ...Full output truncated (42 lines hidden), use '-vv' to show
tests/cal_display_test.py:285: AssertionError
_________________________ test_vertical_month_abbr_fr __________________________
def test_vertical_month_abbr_fr():
# see issue #653
try:
locale.setlocale(locale.LC_ALL, 'fr_FR.UTF-8')
vert_str = vertical_month(month=12, year=2011,
today=datetime.date(2011, 12, 12))
> assert '\n'.join(vert_str) == '\n'.join(example_fr)
E AssertionError: assert '\x1b[1m M... 1 2 3 4 ' == '\x1b[1m
... 1 2 3 4 '
E - [1m Mo Tu We Th Fr Sa Su [0m
E + [1m lu ma me je ve sa di [0m
E - [1mDec [0m28 29 30 1 2 3 4
E ? ^^
E + [1mdéc. [0m28 29 30 1 2 3 4
E ? ^^ ++
E - 5 6 7 8 9 10 11 ...
E
E ...Full output truncated (42 lines hidden), use '-vv' to show
tests/cal_display_test.py:308: AssertionError
_________________ test_description_and_location_and_categories _________________
def test_description_and_location_and_categories():
for data_list, vevent in
test_set_description_and_location_and_categories:
with freeze_time('2014-02-16 12:00:00'):
event = _construct_event(data_list.split(),
description='please describe the
event',
location='in the office',
categories='boring meeting',
locale=LOCALE_BERLIN)
> assert _replace_uid(event).to_ical() == vevent
E AssertionError: assert b'BEGIN:VEVEN...ND:VEVENT\r\n' ==
b'BEGIN:VEVENT...ND:VEVENT\r\n'
E At index 253 diff: 44 != 111
E Left contains more items, first extra item: 10
E Use -v to get the full diff
tests/utils_test.py:569: AssertionError
=============== 5 failed, 268 passed, 2 xfailed in 12.44 seconds ===============
*** Error 1 in . (Makefile:44 'do-test')