Skip to content

Commit 53ccb8a

Browse files
committed
feat: Close lingering shared Peewee connection at end of test session
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
1 parent ea5c376 commit 53ccb8a

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

.github/workflows/pytest_mpflash.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
# branches: [main]
1111

1212
push:
13-
branches: [main, dev/*, mpflash/*, feat/*, fix/*]
13+
# branches: [main, dev/*, mpflash/*, feat/*, fix/*] # ALL
1414
paths:
1515
- .github/workflows/pytest_mpflash.yml
1616
- .github/workflows/codecov.yml
@@ -23,6 +23,8 @@ env:
2323
PYTHONIOENCODING: utf-8
2424
# fix: DeprecationWarning: Jupyter is migrating its paths to use standard platformdirs
2525
JUPYTER_PLATFORM_DIRS: "1"
26+
# Opt into Node.js 24 for all JavaScript actions ahead of runner default switch.
27+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
2628

2729
concurrency:
2830
group: ${{ github.workflow }}-${{ github.ref }}

tests/conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ def pytest_runtest_setup(item):
3131
pytest.skip("cannot run on platform {}".format(platform))
3232

3333

34+
def pytest_sessionfinish(session, exitstatus):
35+
"""Close any lingering shared Peewee connection at end of test session."""
36+
from mpflash.db.models import database
37+
38+
if not database.is_closed():
39+
database.close()
40+
41+
3442
#############################################################
3543
# Fixtures for database testing
3644
#############################################################

0 commit comments

Comments
 (0)