Commit 610a6e91 authored by Jesse Mapel's avatar Jesse Mapel Committed by jlaura
Browse files

Added check for number of connections for db tests (#361)

parent 00d92334
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -157,6 +157,9 @@ def session(tables, request):
            if t in ['Images', 'Cameras', 'Matches', 'Measures']:
                session.execute(f'ALTER SEQUENCE {t}_id_seq RESTART WITH 1')
        session.commit()
        # Ensure that this is the only connection to the DB
        num_con = session.execute('SELECT sum(numbackends) FROM pg_stat_database;').scalar()
        assert num_con == 1

    request.addfinalizer(cleanup)