2020-07-18 16:06:22 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2021-02-19 19:06:45 +00:00
|
|
|
, fetchFromGitHub
|
2022-12-17 10:02:37 +00:00
|
|
|
, fetchpatch
|
2020-07-18 16:06:22 +00:00
|
|
|
, freezegun
|
|
|
|
, pytest
|
2021-02-19 19:06:45 +00:00
|
|
|
, pytestCheckHook
|
2020-07-18 16:06:22 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pytest-freezegun";
|
2020-08-20 17:08:02 +00:00
|
|
|
version = "0.4.2";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2021-02-19 19:06:45 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ktosiek";
|
|
|
|
repo = "pytest-freezegun";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "10c4pbh03b4s1q8cjd75lr0fvyf9id0zmdk29566qqsmaz28npas";
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
# https://github.com/ktosiek/pytest-freezegun/pull/38
|
|
|
|
name = "pytest-freezegun-drop-distutils.patch";
|
|
|
|
url = "https://github.com/ktosiek/pytest-freezegun/commit/03d7107a877e8f07617f931a379f567d89060085.patch";
|
|
|
|
hash = "sha256-/7GTQdidVbE2LT5hwxjEc2dr+aWr6TX1131U4KMQhns=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
buildInputs = [ pytest ];
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
freezegun
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-02-19 19:06:45 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Wrap tests with fixtures in freeze_time";
|
|
|
|
homepage = "https://github.com/ktosiek/pytest-freezegun";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.mic92 ];
|
|
|
|
};
|
|
|
|
}
|