From 731ef3d4c489d5bafd6a5de35e2e305e9ba42240 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 13 Feb 2024 11:52:50 +0100 Subject: [PATCH] python311Packages.pytest-textual-snapshot: init at 0.4.0 Snapshot testing for Textual applications https://github.com/Textualize/pytest-textual-snapshot --- .../pytest-textual-snapshot/default.nix | 56 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 58 insertions(+) create mode 100644 pkgs/development/python-modules/pytest-textual-snapshot/default.nix diff --git a/pkgs/development/python-modules/pytest-textual-snapshot/default.nix b/pkgs/development/python-modules/pytest-textual-snapshot/default.nix new file mode 100644 index 000000000000..d9b51373bcdf --- /dev/null +++ b/pkgs/development/python-modules/pytest-textual-snapshot/default.nix @@ -0,0 +1,56 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, poetry-core +, jinja2 +, pytest +, rich +, pythonOlder +, syrupy +, textual +}: + +buildPythonPackage rec { + pname = "pytest-textual-snapshot"; + version = "0.4.0"; + pyproject = true; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "Textualize"; + repo = "pytest-textual-snapshot"; + rev = "refs/tags/v${version}"; + hash = "sha256-XkXeyodRdwWqCP63Onx82Z3IbNLDDR/Lvaw8xUY7fAg="; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + buildInputs = [ + pytest + ]; + + propagatedBuildInputs = [ + jinja2 + rich + syrupy + textual + ]; + + # Module has no tests + doCheck = false; + + pythonImportsCheck = [ + "pytest_textual_snapshot" + ]; + + meta = with lib; { + description = "Snapshot testing for Textual applications"; + homepage = "https://github.com/Textualize/pytest-textual-snapshot"; + changelog = "https://github.com/Textualize/pytest-textual-snapshot/releases/tag/v${version}"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 71d7fc931e7b..c7c1fdb11ae0 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11717,6 +11717,8 @@ self: super: with self; { pytest-testmon = callPackage ../development/python-modules/pytest-testmon { }; + pytest-textual-snapshot = callPackage ../development/python-modules/pytest-textual-snapshot { }; + pytest-timeout = callPackage ../development/python-modules/pytest-timeout { }; pytest-tornado = callPackage ../development/python-modules/pytest-tornado { };