Skip to content

Commit e963e2f

Browse files
committed
fix: use global instead of pattern
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
1 parent 869a48a commit e963e2f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Lib/test/test_sqlite3/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +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.
1013
def load_tests(loader, tests, pattern):
11-
# Only print on the top-level call
12-
if verbose and pattern is None:
14+
global _printed_version
15+
if verbose and not _printed_version:
1316
print(f"test_sqlite3: testing with SQLite version {sqlite3.sqlite_version}")
17+
_printed_version = True
1418
pkg_dir = os.path.dirname(__file__)
1519
return load_package_tests(pkg_dir, loader, tests, pattern)

0 commit comments

Comments
 (0)