diff --git a/default.nix b/default.nix index 27401736371276c58a0df8b8112c496998aaa4b0..3a47363302f17d5aa412692d43ce90609fb6783d 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 75c594d97a048f3439b632231ed835fd9869f33d..462d8fbc23d692ccce570900ef4efc963e59c411 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 ""; }