return skip_case(reason, __condition=condition)
+def __is_run_slow_not_set(ta):
+ # allow RUN_SLOW being set to the empty string to act like it isn't set
+ return os.environ.get("RUN_SLOW", "") == ""
+
+
+def skip_case_slow(reason):
+ """
+ Conditionally skip a test case if the RUN_SLOW env var isn't set.
+
+ Use like:
+ @skip_case_slow("my reason why it's slow")
+
+ For use with TestAccumulatorBase
+ """
+ # pass a function to run the test in TestAccumulatorBase.__init__ rather
+ # than at module load time.
+ return skip_case_if(__is_run_slow_not_set,
+ "RUN_SLOW env var not set; " + reason)
+
+
def skip_case_if_flag(flag_name):
"""
Skip a test case if `flag_name in TestAccumulatorBase.flags`.