diff --git a/pkgs/development/python-modules/pytest-insta/default.nix b/pkgs/development/python-modules/pytest-insta/default.nix new file mode 100644 index 000000000000..d5915d05c96e --- /dev/null +++ b/pkgs/development/python-modules/pytest-insta/default.nix @@ -0,0 +1,47 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pytest, + pytestCheckHook, + uv-build, + wrapt, +}: + +buildPythonPackage (finalAttrs: rec { + pname = "pytest-insta"; + version = "0.4.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "vberlier"; + repo = pname; + tag = "v${finalAttrs.version}"; + hash = "sha256-zOhWDaCGkE/Ke2MLRyttDH85t+I9kfBZZwVDRN1sprs="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail "uv_build>=0.9.8,<0.10.0" "uv_build" + ''; + + pythonRelaxDeps = [ "wrapt" ]; + + build-system = [ uv-build ]; + + buildInputs = [ pytest ]; + + dependencies = [ wrapt ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + pythonImportsCheck = [ "pytest_insta" ]; + + meta = { + description = "Pytest plugin for snapshot testing"; + homepage = "https://github.com/vberlier/pytest-insta"; + changelog = "https://github.com/vberlier/pytest-insta/blob/v${finalAttrs.src.tag}/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = [ ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 363c6562ed11..e397cd17e5f5 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15207,6 +15207,8 @@ self: super: with self; { pytest-image-diff = callPackage ../development/python-modules/pytest-image-diff { }; + pytest-insta = callPackage ../development/python-modules/pytest-insta { }; + pytest-instafail = callPackage ../development/python-modules/pytest-instafail { }; pytest-integration = callPackage ../development/python-modules/pytest-integration { };