Minor update
Some checks are pending
/ build (macos-latest, 3.8) (push) Waiting to run
/ build (ubuntu-latest, pypy-2.7) (push) Waiting to run
/ build (windows-latest, 3.14) (push) Waiting to run

This commit is contained in:
Miroslav Štampar 2026-07-08 18:00:42 +02:00
parent 8db71f4d67
commit 165bf837c9
3 changed files with 8 additions and 17 deletions

View file

@ -20,7 +20,7 @@ from lib.core.enums import OS
from thirdparty import six
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.10.7.45"
VERSION = "1.10.7.46"
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

View file

@ -122,6 +122,11 @@ class TestReportErrorCapture(unittest.TestCase):
# otherwise gate the ERROR record before it reaches the recorder (order-dependent flakiness)
saved_level = logger.level
logger.setLevel(logging.ERROR)
# mute the existing console handler(s) so the deliberate ERROR below does not leak to the
# unittest output; the recorder added by setupReportCollector next still captures it
muted = [(handler, handler.level) for handler in logger.handlers]
for handler, _ in muted:
handler.setLevel(logging.CRITICAL + 1)
collector = setupReportCollector()
try:
logger.error("boom %s", "here")
@ -129,6 +134,8 @@ class TestReportErrorCapture(unittest.TestCase):
self.assertTrue(any("boom here" in _ for _ in result["error"]))
finally:
logger.setLevel(saved_level)
for handler, level in muted:
handler.setLevel(level)
for handler in list(logger.handlers):
if isinstance(handler, ReportErrorRecorder):
logger.removeHandler(handler)

View file

@ -176,14 +176,9 @@ class TestLinterSelf(unittest.TestCase):
self.assertEqual(checkSanity(u"SELECT \u0131d,ad FROM users"), [])
# module-level coverage accounting (printed in tearDownModule)
_COVERAGE = {"queries_dbms": 0, "queries_atoms": 0, "payload_atoms": 0}
class TestCatalogCoverage(unittest.TestCase):
def test_queries_xml_clean(self):
atoms = _queries_atoms()
_COVERAGE["queries_dbms"] = len(atoms)
total = 0
for dbms, items in atoms.items():
for raw in items:
@ -191,12 +186,10 @@ class TestCatalogCoverage(unittest.TestCase):
issues = checkSanity(_materialize(raw))
self.assertEqual(issues, [],
"queries.xml [%s] malformed atom: %r -> %s" % (dbms, raw, issues))
_COVERAGE["queries_atoms"] = total
self.assertGreater(total, 1000) # sanity: the catalog was actually walked
def test_payloads_xml_clean(self):
items = _payload_atoms()
_COVERAGE["payload_atoms"] = len(items)
for name, title, raw in items:
issues = checkSanity(_materialize(raw))
self.assertEqual(issues, [],
@ -204,14 +197,5 @@ class TestCatalogCoverage(unittest.TestCase):
self.assertGreater(len(items), 500)
def tearDownModule():
q = _COVERAGE
total = q["queries_atoms"] + q["payload_atoms"]
sys.stderr.write(
"\n[sqllint coverage] atom-level: %d SQL atoms linted clean "
"(%d queries.xml across %d/30 DBMSes + %d payloads.xml vectors)\n"
% (total, q["queries_atoms"], q["queries_dbms"], q["payload_atoms"]))
if __name__ == "__main__":
unittest.main(verbosity=2)