Skip to content

Commit

Permalink
Create the pull object earlier
Browse files Browse the repository at this point in the history
This avoids any other factories that might potentially use the pull object
from recreating it in the database
  • Loading branch information
michelletran-codecov committed Oct 31, 2024
1 parent d02c329 commit 6aeac1e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tasks/tests/unit/test_upload_finisher_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,12 @@ def test_finish_reports_processing_with_pull(self, dbsession, mocker):
owner__username="ThiagoCodecov",
yaml=commit_yaml,
)
pull = PullFactory.create(repository=repository)

dbsession.add(repository)
dbsession.add(pull)
dbsession.flush()
pull = PullFactory.create(repository=repository)

compared_to = CommitFactory.create(repository=repository)
pull.compared_to = compared_to.commitid
commit = CommitFactory.create(
Expand All @@ -472,7 +475,6 @@ def test_finish_reports_processing_with_pull(self, dbsession, mocker):
)
dbsession.add(commit)
dbsession.add(compared_to)
dbsession.add(pull)
dbsession.flush()

checkpoints = _create_checkpoint_logger(mocker)
Expand Down

0 comments on commit 6aeac1e

Please sign in to comment.