You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This pathc resets the state of the environment for common
teardown tasks to what it was prior to a test at the end
of the test to reduce the need for test teardown code.
Copy file name to clipboardExpand all lines: docs/development/testing.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -115,8 +115,17 @@ on TestSetup
115
115
end TestSetup
116
116
````
117
117
118
+
118
119
Tests may need to clean up temporary files or other resources after running. If a script test contains a handler called `TestTeardown`, this will be run after running each test command -- even if the test failed. N.b. `TestTeardown` won't be run if running the test command causes an engine crash.
119
120
121
+
Any new objects created on the test stack, `mainstacks`, `sockets`,
122
+
`open processes` and `open files` are automatically cleared after each
123
+
test and do not need to be included in the `TestTeardown` handler or
124
+
teardown included in the test. Other global properties and variables
125
+
should be reset in the test teardown. The test stack is deleted from
126
+
memory and reloaded for the next test if multiple tests are being run
127
+
within the same process as in the standalone test runner.
128
+
120
129
Crashes or uncaught errors from a test command cause the test to immediately fail.
0 commit comments