2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
mock,
|
|
|
|
fetchPypi,
|
|
|
|
pytestCheckHook,
|
|
|
|
python,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools-scm,
|
|
|
|
setuptools,
|
2021-05-03 20:48:10 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pytest-console-scripts";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "1.4.1";
|
2022-03-05 16:20:37 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2021-05-03 20:48:10 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-WoJu2EzAr6IC655EOB19di973ajgwj+feafx9Ez0qJU=";
|
2021-05-03 20:48:10 +00:00
|
|
|
};
|
2022-03-05 16:20:37 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools-scm ];
|
2022-03-05 16:20:37 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [ setuptools ];
|
2022-09-30 11:47:45 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-03-05 16:20:37 +00:00
|
|
|
mock
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Patch the shebang of a script generated during test.
|
2022-03-05 16:20:37 +00:00
|
|
|
substituteInPlace tests/test_run_scripts.py \
|
|
|
|
--replace "#!/usr/bin/env python" "#!${python.interpreter}"
|
2021-05-03 20:48:10 +00:00
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "pytest_console_scripts" ];
|
2021-05-03 20:48:10 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Pytest plugin for testing console scripts";
|
|
|
|
longDescription = ''
|
|
|
|
Pytest-console-scripts is a pytest plugin for running python scripts from within tests.
|
|
|
|
It's quite similar to subprocess.run(), but it also has an in-process mode, where the scripts are executed by the interpreter that's running pytest (using some amount of sandboxing).
|
|
|
|
'';
|
|
|
|
homepage = "https://github.com/kvas-it/pytest-console-scripts";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ AluisioASG ];
|
|
|
|
};
|
|
|
|
}
|