Skip to content

Commit

Permalink
fix: intermittent/flaky test assertion failure in test_sync_courserun…
Browse files Browse the repository at this point in the history
…s_data
  • Loading branch information
mudassir-hafeez committed May 16, 2024
1 parent bcdb166 commit f9b7848
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion courses/tasks_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Tests for Course related tasks"""

import pytest
from collections import Counter

from courses.factories import CourseRunFactory
from courses.tasks import sync_courseruns_data
Expand All @@ -16,4 +17,8 @@ def test_sync_courseruns_data(mocker):
CourseRunFactory.create_batch(size=3, course__is_external=True)

sync_courseruns_data.delay()
sync_course_runs.assert_called_once_with(course_runs)
sync_course_runs.assert_called_once()

called_args, _ = sync_course_runs.call_args
actual_course_runs = called_args[0]
assert Counter(actual_course_runs) == Counter(course_runs)

0 comments on commit f9b7848

Please sign in to comment.