From 18def28d2b1d0aafc45ebe59fc4fe770dfdf2c5d Mon Sep 17 00:00:00 2001 From: mprahl Date: Mon, 15 Jul 2019 10:48:49 -0400 Subject: [PATCH] Fix the unit tests when running with Postgresql --- tests/test_scheduler/test_poller.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_scheduler/test_poller.py b/tests/test_scheduler/test_poller.py index 4dbe66c7..7acc56b7 100644 --- a/tests/test_scheduler/test_poller.py +++ b/tests/test_scheduler/test_poller.py @@ -87,7 +87,7 @@ class TestPoller: poller.poll() # Refresh our module_build object. - db.session.refresh(module_build) + module_build = models.ModuleBuild.query.filter_by(id=3).one() # If fresh is set, we expect the poller to not touch the module build since it's been less # than 10 minutes of inactivity @@ -142,7 +142,7 @@ class TestPoller: poller.poll() # Refresh our module_build object. - db.session.refresh(module_build) + module_build = models.ModuleBuild.query.get(3) if expect_start_build_component: expected_state = koji.BUILD_STATES["BUILDING"] @@ -226,7 +226,7 @@ class TestPoller: poller.poll() # Refresh our module_build object. - db.session.refresh(module_build) + module_build = models.ModuleBuild.query.filter_by(id=3).one() assert not koji_session.newRepo.called assert module_build.new_repo_task_id == 123456 @@ -258,7 +258,7 @@ class TestPoller: poller.poll() # Refresh our module_build object. - db.session.refresh(module_build) + module_build = models.ModuleBuild.query.filter_by(id=3).one() # Components should not be in building state components = module_build.current_batch()