mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-07-04 15:31:11 +00:00
Stabilization of unittests
This commit is contained in:
parent
732d164538
commit
71d9c6d0f4
31 changed files with 200 additions and 58 deletions
|
|
@ -98,6 +98,22 @@ def set_dbms(name):
|
|||
Backend.forceDbms(name)
|
||||
|
||||
|
||||
def reset_dbms():
|
||||
"""Clear any DBMS forced via set_dbms()/Backend, restoring the clean post-bootstrap state.
|
||||
|
||||
A forced DBMS lives on the global `kb` singleton and is read by every dialect/agent path, so a
|
||||
module that forces one without clearing it would leak that back-end into later test modules
|
||||
(order-dependent flakiness). Modules that call set_dbms() should expose this as their
|
||||
`tearDownModule` so the leak can never cross a module boundary.
|
||||
"""
|
||||
from lib.core.common import Backend
|
||||
from lib.core.data import kb
|
||||
from lib.core.settings import UNKNOWN_DBMS_VERSION
|
||||
Backend.flushForcedDbms(force=True) # kb.forcedDbms = None; kb.stickyDBMS = False
|
||||
kb.resolutionDbms = None
|
||||
kb.dbmsVersion = [UNKNOWN_DBMS_VERSION]
|
||||
|
||||
|
||||
# --- property/fuzz testing harness (shared so individual test files don't each reinvent it) ---
|
||||
|
||||
_PROPERTY_BASE = 0x51A1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue