From 3330ead6f52ee6469c7c9f428ae620f246a29cd8 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone <exarkun@twistedmatrix.com> Date: Tue, 15 Oct 2019 16:08:38 -0400 Subject: [PATCH] let me control what tests run --- default.nix | 4 ++-- zkapauthorizer.nix | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/default.nix b/default.nix index 2740173..3a47363 100644 --- a/default.nix +++ b/default.nix @@ -1,2 +1,2 @@ -{ pkgs ? import ./nixpkgs.nix { }, hypothesisProfile ? null, collectCoverage ? false }: -pkgs.python27Packages.zkapauthorizer.override { inherit hypothesisProfile collectCoverage; } +{ pkgs ? import ./nixpkgs.nix { }, hypothesisProfile ? null, collectCoverage ? false, testSuite ? null }: +pkgs.python27Packages.zkapauthorizer.override { inherit hypothesisProfile collectCoverage testSuite; } diff --git a/zkapauthorizer.nix b/zkapauthorizer.nix index 75c594d..462d8fb 100644 --- a/zkapauthorizer.nix +++ b/zkapauthorizer.nix @@ -3,9 +3,11 @@ , fixtures, testtools, hypothesis, pyflakes, treq, coverage , hypothesisProfile ? null , collectCoverage ? false +, testSuite ? null }: let hypothesisProfile' = if hypothesisProfile == null then "default" else hypothesisProfile; + testSuite' = if testSuite == null then "_zkapauthorizer" else testSuite; in buildPythonPackage rec { version = "0.0"; @@ -45,7 +47,7 @@ buildPythonPackage rec { ZKAPAUTHORIZER_HYPOTHESIS_PROFILE=${hypothesisProfile'} python -m ${if collectCoverage then "coverage run --branch --source _zkapauthorizer,twisted.plugins.zkapauthorizer --module" else "" - } twisted.trial _zkapauthorizer + } twisted.trial ${testSuite'} runHook postCheck ''; @@ -54,6 +56,7 @@ buildPythonPackage rec { python -m coverage html mkdir -p "$doc/share/doc/${name}" cp -vr .coverage htmlcov "$doc/share/doc/${name}" + python -m coverage report '' else ""; } -- GitLab