From 8ef5aeead23e5e15fbb82b4bdb2d4c266995ebdc Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Thu, 29 May 2025 15:26:10 -0700 Subject: [PATCH] python3Packages.pytest-icudiff: init at 0.5-unstable-2024-09-04 --- .../python-modules/pytest-icdiff/default.nix | 52 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 54 insertions(+) create mode 100644 pkgs/development/python-modules/pytest-icdiff/default.nix diff --git a/pkgs/development/python-modules/pytest-icdiff/default.nix b/pkgs/development/python-modules/pytest-icdiff/default.nix new file mode 100644 index 000000000000..6b0ba2adfd42 --- /dev/null +++ b/pkgs/development/python-modules/pytest-icdiff/default.nix @@ -0,0 +1,52 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + icdiff, + pprintpp, + pytest, + pytestCheckHook, + writableTmpDirAsHomeHook, +}: + +buildPythonPackage rec { + pname = "pytest-icdiff"; + version = "0.5-unstable-2024-09-04"; + pyproject = true; + + src = fetchFromGitHub { + owner = "hjwp"; + repo = "pytest-icdiff"; + rev = "6e2fb8de35e37428a9f7a268c8abb57e9ee285e5"; + hash = "sha256-kSeGz5IExldgi955XOEkQnc8uqxkbyvuDOdz9y3AFIY="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + pytest + icdiff + pprintpp + ]; + + # These are failing on the main branch; disable for now + disabledTests = [ + "test_long_dict" + "test_mutliline_strings_have_no_escaped_newlines" + ]; + + nativeCheckInputs = [ + pytestCheckHook + writableTmpDirAsHomeHook + ]; + + pythonImportsCheck = [ "pytest_icdiff" ]; + + meta = { + description = "Better error messages in pytest assertions using icdiff"; + homepage = "https://github.com/hjwp/pytest-icdiff"; + license = lib.licenses.unlicense; + maintainers = with lib.maintainers; [ philiptaron ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 9ac94ee07768..b4acb2367c0a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -13865,6 +13865,8 @@ self: super: with self; { pytest-httpx = callPackage ../development/python-modules/pytest-httpx { }; + pytest-icdiff = callPackage ../development/python-modules/pytest-icdiff { }; + pytest-image-diff = callPackage ../development/python-modules/pytest-image-diff { }; pytest-instafail = callPackage ../development/python-modules/pytest-instafail { };