python3Packages.pytest-snapshot: enable tests

This commit is contained in:
Fabian Affolter
2021-12-14 12:04:47 -08:00
committed by Jonathan Ringer
parent fc94f7aaa2
commit e7fbe79667
@@ -1,23 +1,45 @@
{ lib, buildPythonPackage, fetchPypi, packaging, pytest, setuptools-scm }:
{ lib
, buildPythonPackage
, fetchFromGitHub
, packaging
, pytest
, setuptools-scm
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "pytest-snapshot";
version = "0.8.0";
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "cf84c88c3e0b4ae08ae797d9ccdc32715b64dd68b2da40f575db56956ed23326";
src = fetchFromGitHub {
owner = "joseph-roitman";
repo = pname;
rev = "v${version}";
sha256 = "sha256-xnfsB4wmsvqq5FfhLasSpxZh7+vhQsND6+Lxu0OuCvs=";
};
nativeBuildInputs = [ setuptools-scm ];
SETUPTOOLS_SCM_PRETEND_VERSION = version;
buildInputs = [ pytest ];
nativeBuildInputs = [
setuptools-scm
];
propagatedBuildInputs = [ packaging ];
buildInputs = [
pytest
];
# pypi does not contain tests and GitHub archive is not supported because setuptools-scm can't detect the version
doCheck = false;
pythonImportsCheck = [ "pytest_snapshot" ];
propagatedBuildInputs = [
packaging
];
checkInputs = [
pytestCheckHook
];
pythonImportsCheck = [
"pytest_snapshot"
];
meta = with lib; {
description = "A plugin to enable snapshot testing with pytest";