diff --git a/pkgs/development/python-modules/colorcet/default.nix b/pkgs/development/python-modules/colorcet/default.nix index 83095a6a5626..6a7328aaf73c 100644 --- a/pkgs/development/python-modules/colorcet/default.nix +++ b/pkgs/development/python-modules/colorcet/default.nix @@ -31,6 +31,10 @@ buildPythonPackage rec { ]; checkPhase = '' + export HOME=$(mktemp -d) + mkdir -p $HOME/.config/matplotlib + echo "backend: ps" > $HOME/.config/matplotlib/matplotlibrc + pytest colorcet ''; diff --git a/pkgs/development/python-modules/pytest-mpl/default.nix b/pkgs/development/python-modules/pytest-mpl/default.nix new file mode 100644 index 000000000000..c3bd4c59f049 --- /dev/null +++ b/pkgs/development/python-modules/pytest-mpl/default.nix @@ -0,0 +1,37 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pytest +, matplotlib +, nose +}: + +buildPythonPackage rec { + pname = "pytest-mpl"; + version = "0.10"; + + src = fetchPypi { + inherit pname version; + sha256 = "7006e63bf1ca9c50bea3d189c0f862751a16ce40bb373197b218f57af5b837c0"; + }; + + propagatedBuildInputs = [ + matplotlib + nose + ]; + + checkInputs = [ + pytest + ]; + + checkPhase = '' + pytest + ''; + + meta = with lib; { + description = "pytest plugin to help with testing figures output from Matplotlib"; + homepage = https://github.com/matplotlib/pytest-mpl; + license = licenses.bsd3; + maintainers = [ maintainers.costrouc ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5b3776da5c30..dcefe43d0c9f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1917,6 +1917,8 @@ in { pytest-isort = callPackage ../development/python-modules/pytest-isort { }; + pytest-mpl = callPackage ../development/python-modules/pytest-mpl { }; + pytest-mock = callPackage ../development/python-modules/pytest-mock { }; pytest-timeout = callPackage ../development/python-modules/pytest-timeout { };