From 5c7461478b3b0fcfa315876fd3ec915242d68566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 2 Mar 2021 23:54:53 +0100 Subject: [PATCH] pythonPackages.datadog: fix tests --- .../python-modules/datadog/default.nix | 48 +++++++++++++++---- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/datadog/default.nix b/pkgs/development/python-modules/datadog/default.nix index a8917c3965f8..4a1bddfe3692 100644 --- a/pkgs/development/python-modules/datadog/default.nix +++ b/pkgs/development/python-modules/datadog/default.nix @@ -1,6 +1,19 @@ -{ lib, buildPythonPackage, fetchPypi, pythonOlder -, decorator, requests, simplejson, pillow, typing -, nose, mock, pytest, freezegun }: +{ lib +, buildPythonPackage +, fetchPypi +, pythonOlder +, decorator +, requests +, typing +, configparser +, click +, freezegun +, mock +, pytestCheckHook +, pytest-vcr +, python-dateutil +, vcrpy +}: buildPythonPackage rec { pname = "datadog"; @@ -15,13 +28,30 @@ buildPythonPackage rec { find . -name '*.pyc' -exec rm {} \; ''; - propagatedBuildInputs = [ decorator requests simplejson pillow ] - ++ lib.optionals (pythonOlder "3.5") [ typing ]; + propagatedBuildInputs = [ decorator requests ] + ++ lib.optional (pythonOlder "3.5") typing + ++ lib.optional (pythonOlder "3.0") configparser; - checkInputs = [ nose mock pytest freezegun ]; - checkPhase = '' - pytest tests/unit - ''; + checkInputs = [ + click + freezegun + mock + pytestCheckHook + pytest-vcr + python-dateutil + vcrpy + ]; + + disabledTestPaths = [ + "tests/unit/dogstatsd/test_statsd.py" # does not work in sandbox + ]; + + disabledTests = [ + "test_default_settings_set" + "test_threadstats_thread_safety" + ]; + + pythonImportsCheck = [ "datadog" ]; meta = with lib; { description = "The Datadog Python library";