mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-04 14:55:40 +00:00
Minor fix
This commit is contained in:
parent
7774c73291
commit
fd7eaf107b
7 changed files with 52 additions and 12 deletions
|
|
@ -77,7 +77,18 @@ class _CrackBase(unittest.TestCase):
|
|||
conf.hashDB = None
|
||||
kb.wordlists = [self.wordlist]
|
||||
|
||||
# cracking prints "[INFO] cracked password ..." via dataToStdout(forceOutput=True), which
|
||||
# bypasses both the logger and kb.wizardMode suppression; redirect stdout so the unittest
|
||||
# report stays clean (these tests assert on return values/kb, never on console output).
|
||||
self._saved_stdout = sys.stdout
|
||||
sys.stdout = open(os.devnull, "w")
|
||||
|
||||
def tearDown(self):
|
||||
if getattr(self, "_saved_stdout", None) is not None:
|
||||
try:
|
||||
sys.stdout.close()
|
||||
finally:
|
||||
sys.stdout = self._saved_stdout
|
||||
conf.disableMulti = self._saved["disableMulti"]
|
||||
conf.hashDB = self._saved["hashDB"]
|
||||
conf.hashFile = self._saved["hashFile"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue