Skip to content

Commit 9393e2d

Browse files
committed
Ignore sqlite resource warnings in tests
1 parent 637bcd0 commit 9393e2d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

python/lsst/sconsUtils/tests.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,10 @@ def run(self, fileGlob):
248248
if f.endswith(".cc"): # look for executable
249249
f = os.path.splitext(f)[0]
250250
else:
251-
interpreter = "pytest -Wd --durations=5 --junit-xml=${TARGET}.xml"
251+
interpreter = "pytest"
252+
interpreter += ' -Wd -W "ignore:unclosed database in <sqlite3.Connection:ResourceWarning"'
253+
interpreter += " -p no:unraisableexception"
254+
interpreter += " --durations=5 --junit-xml=${TARGET}.xml"
252255
interpreter += f" --junit-prefix={self.junitPrefix()}"
253256
interpreter += " --log-level=DEBUG"
254257
interpreter += self._getPytestCoverageCommand()
@@ -433,7 +436,9 @@ def runPythonTests(self, pyList):
433436
# We have decided to use pytest caching so that on reruns we only
434437
# run failed tests.
435438
lfnfOpt = "none" if "install" in SCons.Script.COMMAND_LINE_TARGETS else "all"
436-
interpreter = f"pytest -Wd --lf --lfnf={lfnfOpt}"
439+
interpreter = f"pytest --lf --lfnf={lfnfOpt}"
440+
interpreter += ' -Wd -W "ignore:unclosed database in <sqlite3.Connection:ResourceWarning"'
441+
interpreter += " -p no:unraisableexception"
437442
interpreter += " --durations=5 --junit-xml=${TARGET} --session2file=${TARGET}.out"
438443
interpreter += f" --junit-prefix={self.junitPrefix()}"
439444
interpreter += " --log-level=DEBUG"

0 commit comments

Comments
 (0)