Skip to content

Commit

Permalink
test: quality updates
Browse files Browse the repository at this point in the history
  • Loading branch information
DawoudSheraz committed Mar 4, 2024
1 parent 05f78af commit 1596e7e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion course_discovery/apps/api/tests/test_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class TestAPIView(AnonymousUserThrottleAuthenticatedEndpointMixin, APIView):
permission_classes = ()
authentication_classes = ()

def get(self, request, *_args, **_kwargs): # pylint: disable=unused-argument
def get(self, request, *_args, **_kwargs):
return Response(
status=status.HTTP_200_OK,
data="Hello, World"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,10 @@ def test_ingest_flow_for_preexisting_published_course_with_new_run_creation(self
CourseRunFactory(
course=course,
start=datetime.datetime(2014, 3, 1, tzinfo=UTC),
end=datetime.datetime(2024, 3, 1, tzinfo=UTC),
# 2050 end date is to ensure the course run is present among active runs and thus
# non-draft entries are created. If the discovery is there till 2050, you would need to update the
# tests after Jan 1, 2050.
end=datetime.datetime(2050, 1, 1, tzinfo=UTC),
key=self.COURSE_RUN_KEY,
type=self.course_run_type,
status='published',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ def get_query_results_from_snowflake(self):
try:
cs.execute(SNOWFLAKE_POPULATE_COURSE_LENGTH_QUERY)
rows = cs.fetchall()
for row in rows:
yield row
yield from rows
finally:

Check warning on line 49 in course_discovery/apps/course_metadata/management/commands/populate_course_length.py

View check run for this annotation

Codecov / codecov/patch

course_discovery/apps/course_metadata/management/commands/populate_course_length.py#L48-L49

Added lines #L48 - L49 were not covered by tests
cs.close()
ctx.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ def get_query_results_from_snowflake(self):
try:
cs.execute(SNOWFLAKE_REFRESH_COURSE_REVIEWS_QUERY)
rows = cs.fetchall()
for row in rows:
yield row
yield from rows
finally:
cs.close()
ctx.close()
Expand Down
1 change: 0 additions & 1 deletion course_discovery/apps/course_metadata/tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
from course_discovery.apps.course_metadata.tests import factories


# pylint: disable=no-member
@ddt.ddt
class AdminTests(SiteMixin, TestCase):
""" Tests Admin page."""
Expand Down

0 comments on commit 1596e7e

Please sign in to comment.