From fe28c6aed6b9108c656c16fcb85e2e63ecfb4010 Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Fri, 2 Jul 2021 00:34:26 -0600 Subject: [PATCH] khal: disable failing tests and cleanup test logic Closes #128751 --- pkgs/applications/misc/khal/default.nix | 28 +++++++--------- .../misc/khal/skip-broken-test.patch | 33 ------------------- 2 files changed, 11 insertions(+), 50 deletions(-) delete mode 100644 pkgs/applications/misc/khal/skip-broken-test.patch diff --git a/pkgs/applications/misc/khal/default.nix b/pkgs/applications/misc/khal/default.nix index 5c6b505dd683..ab333c4f798d 100644 --- a/pkgs/applications/misc/khal/default.nix +++ b/pkgs/applications/misc/khal/default.nix @@ -9,10 +9,6 @@ with python3.pkgs; buildPythonApplication rec { sha256 = "sha256-L92PwU/ll+Wn1unGPHho2WC07QIbVjxoSnHwcJDtpDI="; }; - patches = [ - ./skip-broken-test.patch - ]; - propagatedBuildInputs = [ atomicwrites click @@ -31,16 +27,12 @@ with python3.pkgs; buildPythonApplication rec { freezegun ]; nativeBuildInputs = [ setuptools-scm sphinx sphinxcontrib_newsfeed ]; - checkInputs = [ pytest glibcLocales ]; + checkInputs = [ + glibcLocales + pytestCheckHook + ]; LC_ALL = "en_US.UTF-8"; - postPatch = '' - sed -i \ - -e "s/Invalid value for \"ics\"/Invalid value for \\\'ics\\\'/" \ - -e "s/Invalid value for \"\[ICS\]\"/Invalid value for \\\'\[ICS\]\\\'/" \ - tests/cli_test.py - ''; - postInstall = '' # zsh completion install -D misc/__khal $out/share/zsh/site-functions/__khal @@ -56,11 +48,13 @@ with python3.pkgs; buildPythonApplication rec { doCheck = !stdenv.isAarch64; - checkPhase = '' - py.test -k "not test_vertical_month_abbr_fr and not test_vertical_month_unicode_weekdeays_gr \ - and not test_event_different_timezones and not test_default_calendar and not test_birthdays \ - and not test_birthdays_no_year" - ''; + disabledTests = [ + # This test is failing due to https://github.com/pimutils/khal/issues/1065 + "test_print_ics_command" + + # Mocking breaks in this testcase + "test_import_from_stdin" + ]; meta = with lib; { homepage = "http://lostpackets.de/khal/"; diff --git a/pkgs/applications/misc/khal/skip-broken-test.patch b/pkgs/applications/misc/khal/skip-broken-test.patch deleted file mode 100644 index fc37f6acc86e..000000000000 --- a/pkgs/applications/misc/khal/skip-broken-test.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff --git a/tests/cli_test.py b/tests/cli_test.py -index 5e354a5..d8fbcd5 100644 ---- a/tests/cli_test.py -+++ b/tests/cli_test.py -@@ -493,6 +493,7 @@ def test_import_invalid_choice_and_prefix(runner): - assert result.output == '09.04.-09.04. An Event\n' - - -+@pytest.mark.skip(reason="Mocking breaks in this testcase") - def test_import_from_stdin(runner, monkeypatch): - ics_data = 'This is some really fake icalendar data' - -diff --git a/tests/ui/test_editor.py b/tests/ui/test_editor.py -index 27b7fa5..5978d72 100644 ---- a/tests/ui/test_editor.py -+++ b/tests/ui/test_editor.py -@@ -1,5 +1,7 @@ - import datetime as dt - -+import pytest -+ - import icalendar - from khal.ui.editor import RecurrenceEditor, StartEndEditor - -@@ -19,7 +21,7 @@ palette = { - 'edit': 'blue', - } - -- -+@pytest.mark.skip(reason="Mocking breaks in this testcase") - def test_popup(monkeypatch): - """making sure the popup calendar gets callend with the right inital value -