Skip to content

Commit 57b37a9

Browse files
[3.14] gh-139743: Avoid print twice verbose version for sqlite tests (GH-142850) (GH-142865)
(cherry picked from commit 454485e) Signed-off-by: yihong0618 <zouzou0208@gmail.com> Co-authored-by: yihong <zouzou0208@gmail.com>
1 parent 897e2b4 commit 57b37a9

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Lib/test/test_sqlite3/__init__.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@
66
import os
77
import sqlite3
88

9+
# make sure only print once
10+
_printed_version = False
11+
912
# Implement the unittest "load tests" protocol.
10-
def load_tests(*args):
11-
if verbose:
13+
def load_tests(loader, tests, pattern):
14+
global _printed_version
15+
if verbose and not _printed_version:
1216
print(f"test_sqlite3: testing with SQLite version {sqlite3.sqlite_version}")
17+
_printed_version = True
1318
pkg_dir = os.path.dirname(__file__)
14-
return load_package_tests(pkg_dir, *args)
19+
return load_package_tests(pkg_dir, loader, tests, pattern)

0 commit comments

Comments
 (0)