Skip to content

Commit 6430782

Browse files
committed
retest: allow overriding kwargs defaults via __retest_defaults__
1 parent e93d3aa commit 6430782

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/ReTest.jl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,13 @@ const retest_defaults = (
495495
spin = true,
496496
)
497497

498-
def(kw::Symbol) = retest_defaults[kw]
498+
def(kw::Symbol) =
499+
if isdefined(Main, :__retest_defaults__)
500+
# TODO: test __retest_defaults__
501+
get(Main.__retest_defaults__, kw, retest_defaults[kw])
502+
else
503+
retest_defaults[kw]
504+
end
499505

500506

501507
"""
@@ -554,6 +560,10 @@ Filtering `pattern`s can be specified to run only a subset of the tests.
554560
`Threads.nthreads()` should be greater than `1` for `spin` to take effect).
555561
Note also that this feature slows down a bit the execution of tests.
556562
563+
The default values of these keywords can be overriden by defining a dictionary
564+
or named tuple within `Main` called `__retest_defaults__`, whose keys are
565+
symbols. E.g. `__retest_defaults__ = (verbose=Inf, spin=false)`.
566+
557567
558568
### Filtering
559569

0 commit comments

Comments
 (0)