Skip to content

Commit

Permalink
Test not closing session in server init
Browse files Browse the repository at this point in the history
Signed-off-by: Mattia Verga <[email protected]>
  • Loading branch information
mattiaverga committed Mar 25, 2024
1 parent 30ffe50 commit 6feb54e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
3 changes: 0 additions & 3 deletions bodhi-server/bodhi/server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,6 @@ def main(global_config, testing=None, session=None, **settings):
# the return value.
generic._generate_home_page_stats()

# Let's close out the db session we used to warm the caches.
Session.remove()

log.info('Bodhi ready and at your service!')
app = config.make_wsgi_app()
return app
7 changes: 0 additions & 7 deletions bodhi-server/tests/test___init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,6 @@ def test_authtkt_timeout_undefined(self, set_security_policy):
assert policy.helper.timeout == 86400
set_security_policy.assert_called_once_with(policy)

def test_calls_session_remove(self):
"""Let's assert that main() calls Session.remove()."""
with mock.patch('bodhi.server.Session.remove') as remove:
server.main({}, session=self.db, **self.app_settings)

remove.assert_called_once_with()

@mock.patch('bodhi.server.bugs.set_bugtracker')
def test_calls_set_bugtracker(self, set_bugtracker):
"""
Expand Down

0 comments on commit 6feb54e

Please sign in to comment.