From 239e65624bacf273022ee9cd3073cf9727dc0bf4 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone <exarkun@twistedmatrix.com> Date: Fri, 11 Oct 2019 14:55:30 -0400 Subject: [PATCH] make hypothesis profiles work --- src/_zkapauthorizer/tests/__init__.py | 4 +++- zkapauthorizer.nix | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/_zkapauthorizer/tests/__init__.py b/src/_zkapauthorizer/tests/__init__.py index 7bee673..1fd9a9d 100644 --- a/src/_zkapauthorizer/tests/__init__.py +++ b/src/_zkapauthorizer/tests/__init__.py @@ -44,10 +44,12 @@ def _configure_hypothesis(): settings.register_profile( "big", - max_examples=100000, + max_examples=10000, + deadline=None, ) profile_name = environ.get("ZKAPAUTHORIZER_HYPOTHESIS_PROFILE", "default") settings.load_profile(profile_name) + print("Loaded profile {}".format(profile_name)) _configure_hypothesis() diff --git a/zkapauthorizer.nix b/zkapauthorizer.nix index ae74536..6572ed3 100644 --- a/zkapauthorizer.nix +++ b/zkapauthorizer.nix @@ -1,7 +1,7 @@ { buildPythonPackage, sphinx, circleci-cli , attrs, zope_interface, twisted, tahoe-lafs, privacypass , fixtures, testtools, hypothesis, pyflakes, treq, coverage -, hypothesisProfile ? null +, hypothesisProfile ? "default" , collectCoverage ? false }: buildPythonPackage rec { @@ -34,10 +34,12 @@ buildPythonPackage rec { treq ]; + + checkPhase = '' runHook preCheck "${pyflakes}/bin/pyflakes" src/_zkapauthorizer - python -m ${if collectCoverage + ZKAPAUTHORIZER_HYPOTHESIS_PROFILE=${hypothesisProfile} python -m ${if collectCoverage then "coverage run --branch --source _zkapauthorizer,twisted.plugins.zkapauthorizer --module" else "" } twisted.trial _zkapauthorizer -- GitLab