diff options
author | Rostyslav Dzinko <rostislav.dzinko@gmail.com> | 2015-09-17 12:50:51 +0300 |
---|---|---|
committer | Rostyslav Dzinko <rostislav.dzinko@gmail.com> | 2015-09-17 13:11:51 +0300 |
commit | e02e8968c4ae11fc9f8230c449526aa7c87f9231 (patch) | |
tree | 45d5df3095b55df40ab794b2a619dc0617bae95a | |
parent | 671e5db21e49fa4efbfe46a5215673f5826b25c3 (diff) | |
download | Nim-e02e8968c4ae11fc9f8230c449526aa7c87f9231.tar.gz |
Moved teardown call to try block for namespace access reasons
-rwxr-xr-x | lib/pure/unittest.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/pure/unittest.nim b/lib/pure/unittest.nim index a0f7b955e..aca9d51e2 100755 --- a/lib/pure/unittest.nim +++ b/lib/pure/unittest.nim @@ -150,6 +150,8 @@ template test*(name: expr, body: stmt): stmt {.immediate, dirty.} = try: when declared(testSetupIMPLFlag): testSetupIMPL() body + when declared(testTeardownIMPLFlag): + defer: testTeardownIMPL() except: when not defined(js): @@ -158,7 +160,6 @@ template test*(name: expr, body: stmt): stmt {.immediate, dirty.} = fail() finally: - when declared(testTeardownIMPLFlag): testTeardownIMPL() testDone name, testStatusIMPL proc checkpoint*(msg: string) = |