From 165bf837c937cc7bd57ba4c55622af5e4fa4905c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0tampar?= Date: Wed, 8 Jul 2026 18:00:42 +0200 Subject: [PATCH] Minor update --- lib/core/settings.py | 2 +- tests/test_library.py | 7 +++++++ tests/test_sqllint.py | 16 ---------------- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/lib/core/settings.py b/lib/core/settings.py index 0560348ff..1cb6c5ddf 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -20,7 +20,7 @@ from lib.core.enums import OS from thirdparty import six # sqlmap version (...) -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) diff --git a/tests/test_library.py b/tests/test_library.py index 8437238e5..36a608e31 100644 --- a/tests/test_library.py +++ b/tests/test_library.py @@ -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) diff --git a/tests/test_sqllint.py b/tests/test_sqllint.py index b5389e756..63f409ff1 100644 --- a/tests/test_sqllint.py +++ b/tests/test_sqllint.py @@ -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)