diff --git a/pkgs/development/python-modules/pytest-openfiles/default.nix b/pkgs/development/python-modules/pytest-openfiles/default.nix new file mode 100644 index 000000000000..dbce114d7bf8 --- /dev/null +++ b/pkgs/development/python-modules/pytest-openfiles/default.nix @@ -0,0 +1,42 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pytest +, psutil +}: + +buildPythonPackage rec { + pname = "pytest-openfiles"; + version = "0.3.2"; + + src = fetchPypi { + inherit pname version; + sha256 = "e51c91889eb9e4c75f47735efc57a1435f3f1182463600ba7bce7f2556a46884"; + }; + + propagatedBuildInputs = [ + pytest + psutil + ]; + + checkInputs = [ + pytest + ]; + + postConfigure = '' + # remove on next release + substituteInPlace setup.cfg \ + --replace "[pytest]" "[tool:pytest]" + ''; + + checkPhase = '' + pytest + ''; + + meta = with lib; { + description = "Pytest plugin for detecting inadvertent open file handles"; + homepage = https://astropy.org; + license = licenses.bsd3; + maintainers = [ maintainers.costrouc ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2cc7a3426bd3..e5288b5f8e02 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1935,6 +1935,8 @@ in { pytest-mock = callPackage ../development/python-modules/pytest-mock { }; + pytest-openfiles = callPackage ../development/python-modules/pytest-openfiles { }; + pytest-timeout = callPackage ../development/python-modules/pytest-timeout { }; pytest-warnings = callPackage ../development/python-modules/pytest-warnings { };