summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--changelog.md2
-rw-r--r--lib/pure/unittest.nim5
2 files changed, 6 insertions, 1 deletions
diff --git a/changelog.md b/changelog.md
index 8fac8dab6..3e498e7f8 100644
--- a/changelog.md
+++ b/changelog.md
@@ -52,8 +52,8 @@
   This simplifies code by reducing need for if-else branches around intermediate maybe nil values.
   Eg: `echo ?.n.typ.kind`
 - Added `minIndex` and `maxIndex` to the `sequtils` module
-
 - Added `os.isRelativeTo` to tell whether a path is relative to another
+- Added `resetOutputFormatters` to `unittest`
 
 ## Library changes
 
diff --git a/lib/pure/unittest.nim b/lib/pure/unittest.nim
index c3e3a8876..c50ef0b1b 100644
--- a/lib/pure/unittest.nim
+++ b/lib/pure/unittest.nim
@@ -96,6 +96,8 @@
 import
   macros, strutils, streams, times, sets, sequtils
 
+include "system/inclrtl"
+
 when declared(stdout):
   import os
 
@@ -186,6 +188,9 @@ proc delOutputFormatter*(formatter: OutputFormatter) =
   keepIf(formatters, proc (x: OutputFormatter): bool =
     x != formatter)
 
+proc resetOutputFormatters* {.since: (1, 1).} =
+  formatters = @[]
+    
 proc newConsoleOutputFormatter*(outputLevel: OutputLevel = OutputLevel.PRINT_ALL,
                                 colorOutput = true): <//>ConsoleOutputFormatter =
   ConsoleOutputFormatter(