Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f22fd39

Browse files
committed
write the test case name before it is run so if the test case crashes badly, we can trace back what test case it was at a later stage
1 parent 47f0d89 commit f22fd39

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/core/testing.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ def liveTest():
167167

168168
result = runCase(switches, parse)
169169

170+
test_case_fd = codecs.open(os.path.join(paths.SQLMAP_OUTPUT_PATH, "test_case"), "wb", UNICODE_ENCODING)
171+
test_case_fd.write(name)
172+
test_case_fd.close()
173+
170174
if result:
171175
logger.info("test passed")
172176
cleanCase()
@@ -184,10 +188,6 @@ def liveTest():
184188

185189
logger.error(errMsg)
186190

187-
test_case_fd = codecs.open(os.path.join(paths.SQLMAP_OUTPUT_PATH, "test_case"), "wb", UNICODE_ENCODING)
188-
test_case_fd.write(msg)
189-
test_case_fd.close()
190-
191191
if failedParseOn:
192192
console_output_fd = codecs.open(os.path.join(paths.SQLMAP_OUTPUT_PATH, "console_output"), "wb", UNICODE_ENCODING)
193193
console_output_fd.write(failedParseOn)

0 commit comments

Comments
 (0)