From 7e929898d7c3ed6c274da84833c1aa593987af5b Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Mon, 15 Jul 2019 11:56:28 -0400 Subject: [PATCH] pythonPackages.pytest-socket: init at 0.3.3 --- .../python-modules/pytest-socket/default.nix | 40 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 42 insertions(+) create mode 100644 pkgs/development/python-modules/pytest-socket/default.nix diff --git a/pkgs/development/python-modules/pytest-socket/default.nix b/pkgs/development/python-modules/pytest-socket/default.nix new file mode 100644 index 000000000000..a28970a8ec45 --- /dev/null +++ b/pkgs/development/python-modules/pytest-socket/default.nix @@ -0,0 +1,40 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytest +}: + +buildPythonPackage rec { + pname = "pytest-socket"; + version = "0.3.3"; + + src = fetchFromGitHub { + owner = "miketheman"; + repo = pname; + rev = version; + sha256 = "1jbzkyp4xki81h01yl4vg3nrg9b6shsk1ryrmkaslffyhrqnj8zh"; + }; + + propagatedBuildInputs = [ + pytest + ]; + + checkInputs = [ + pytest + ]; + + checkPhase = '' + pytest + ''; + + # unsurprisingly pytest-socket require network for majority of tests + # to pass... + doCheck = false; + + meta = with lib; { + description = "Pytest Plugin to disable socket calls during tests"; + homepage = https://github.com/miketheman/pytest-socket; + license = licenses.mit; + maintainers = [ maintainers.costrouc ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 9e2c25be0145..623d84730e17 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1965,6 +1965,8 @@ in { pytest-shutil = callPackage ../development/python-modules/pytest-shutil { }; + pytest-socket = callPackage ../development/python-modules/pytest-socket { }; + pytestcov = callPackage ../development/python-modules/pytest-cov { }; pytest-expect = callPackage ../development/python-modules/pytest-expect { };