coveralls: 
[![Coverage Status](https://coveralls.io/builds/15634324/badge)](https://coveralls.io/builds/15634324)

Coverage remained the same at 100.0% when pulling **482ea1d76add02887435faf7f61e5f4125af43a4 on andrew-gardener:issue/154-course-sections-converage** into **5a3b536d9cff7d79df58203f64531cf649a6d942 on ucfopen:develop**.

Thetwam: Hey @andrew-gardener, thanks for the pull request!

I believe we already cover this endpoint as [`Course.list_sections()`](http://canvasapi.readthedocs.io/en/latest/course-ref.html#canvasapi.course.Course.list_sections) ([here in the repo](https://github.com/ucfopen/canvasapi/blob/fec74692326591055df97451dd1fc24ff6e4dd0c/canvasapi/course.py#L673)). 

Internally, we have been talking about standardizing methods to always use the prefix `get_` rather than `list_` to avoid confusion. This seems like a good opportunity to change `list_sections` to `get_sections` for clarity. I've opened an issue for us to go through the library and change all `get_` to `list_` (#156), but for now we'll just do sections.

Your changes to `Course.get_section()` looks good! Good catch.

Would you like to handle the changing of `list_sections` to `get_sections`?
andrew-gardener: @Thetwam my bad! I didn't realize that it existed as `list_sections`

I've updated the PR to with the deprecation warning.
diff --git a/canvasapi/course.py b/canvasapi/course.py
index e06fd8c..df55c63 100644
--- a/canvasapi/course.py
+++ b/canvasapi/course.py
@@ -1,5 +1,6 @@
 from __future__ import absolute_import, division, print_function, unicode_literals
-from warnings import warn
+
+import warnings
 
 from six import python_2_unicode_compatible, text_type
 
@@ -17,6 +18,8 @@ from canvasapi.user import UserDisplay
 from canvasapi.util import combine_kwargs, is_multivalued, obj_or_id
 from canvasapi.rubric import Rubric
 
+warnings.simplefilter('always', DeprecationWarning)
+
 
 @python_2_unicode_compatible
 class Course(CanvasObject):
@@ -541,12 +544,32 @@ class Course(CanvasObject):
             _kwargs=combine_kwargs(**kwargs)
         )
 
-    def get_section(self, section):
+    def get_sections(self, **kwargs):
+        """
+        List all sections in a course.
+
+        :calls: `GET /api/v1/courses/:course_id/sections \
+        <https://canvas.instructure.com/doc/api/sections.html#method.sections.index>`_
+
+        :rtype: :class:`canvasapi.paginated_list.PaginatedList` of
+            :class:`canvasapi.section.Section`
+        """
+        from canvasapi.section import Section
+
+        return PaginatedList(
+            Section,
+            self._requester,
+            'GET',
+            'courses/{}/sections'.format(self.id),
+            _kwargs=combine_kwargs(**kwargs)
+        )
+
+    def get_section(self, section, **kwargs):
         """
         Retrieve a section.
 
         :calls: `GET /api/v1/courses/:course_id/sections/:id \
-        <https://canvas.instructure.com/doc/api/sections.html#method.sections.index>`_
+        <https://canvas.instructure.com/doc/api/sections.html#method.sections.show>`_
 
         :param section: The object or ID of the section to retrieve.
         :type section: :class:`canvasapi.section.Section` or int
@@ -559,7 +582,8 @@ class Course(CanvasObject):
 
         response = self._requester.request(
             'GET',
-            'courses/{}/sections/{}'.format(self.id, section_id)
+            'courses/{}/sections/{}'.format(self.id, section_id),
+            _kwargs=combine_kwargs(**kwargs)
         )
         return Section(self._requester, response.json())
 
@@ -680,14 +704,12 @@ class Course(CanvasObject):
         :rtype: :class:`canvasapi.paginated_list.PaginatedList` of
             :class:`canvasapi.section.Section`
         """
-        from canvasapi.section import Section
-        return PaginatedList(
-            Section,
-            self._requester,
-            'GET',
-            'courses/{}/sections'.format(self.id),
-            _kwargs=combine_kwargs(**kwargs)
+        warnings.warn(
+            "`list_sections` is being deprecated and will be removed in a future version."
+            " Use `get_sections` instead",
+            DeprecationWarning
         )
+        return self.get_sections(**kwargs)
 
     def create_course_section(self, **kwargs):
         """
@@ -1202,7 +1224,7 @@ class Course(CanvasObject):
             :class:`canvasapi.submission.Submission`
         """
         if 'grouped' in kwargs:
-            warn('The `grouped` parameter must be empty. Removing kwarg `grouped`.')
+            warnings.warn('The `grouped` parameter must be empty. Removing kwarg `grouped`.')
             del kwargs['grouped']
 
         return PaginatedList(

Course sections coverage
Add coverage for course sections

https://canvas.instructure.com/doc/api/sections.html#method.sections.index

Also improve course section coverage to support the `include` parameter

https://canvas.instructure.com/doc/api/sections.html#method.sections.show
diff --git a/tests/fixtures/course.json b/tests/fixtures/course.json
index 1aa9eb8..fa235c6 100644
--- a/tests/fixtures/course.json
+++ b/tests/fixtures/course.json
@@ -346,6 +346,43 @@
 		},
 		"status_code": 200
 	},
+	"get_sections": {
+		"method": "GET",
+		"endpoint": "courses/1/sections",
+		"data": [
+            {
+                "id": 1,
+                "name": "Section 1",
+                "course_id": 1
+            },
+            {
+                "id": 2,
+                "name": "Section 2",
+                "course_id": 1
+            }
+		],
+		"headers": {
+			"Link": "<http://example.com/api/v1/courses/1/sections?page=2&per_page=2>; rel=\"next\""
+		},
+		"status_code": 200
+	},
+	"get_sections_p2": {
+		"method": "GET",
+		"endpoint": "courses/1/sections?page=2&per_page=2",
+		"data": [
+            {
+                "id": 3,
+                "name": "Section 3",
+                "course_id": 1
+            },
+            {
+                "id": 4,
+                "name": "Section 4",
+                "course_id": 1
+            }
+		],
+		"status_code": 200
+	},
 	"get_user": {
 		"method": "GET",
 		"endpoint": "courses/1/users/1",
@@ -872,39 +909,6 @@
 		},
 		"status_code": 200
 	},
-	"list_sections": {
-		"method": "GET",
-		"endpoint": "courses/1/sections",
-		"data": [
-			{
-				"id": 1,
-				"name": "Section 1"
-			},
-			{
-				"id": 2,
-				"name": "Section 2"
-			}
-		],
-		"status_code": 200,
-		"headers": {
-			"Link": "<http://example.com/api/v1/courses/1/list_sections?page=2&per_page=2>; rel=\"next\""
-		}
-	},
-	"list_sections2": {
-		"method": "GET",
-		"endpoint": "courses/1/list_sections?page=2&per_page=2",
-		"data": [
-			{
-				"id": 3,
-				"name": "Section 3"
-			},
-			{
-				"id": 4,
-				"name": "Section 4"
-			}
-		],
-		"status_code": 200
-	},
 	"create_section": {
 		"method": "POST",
 		"endpoint": "courses/1/sections",
diff --git a/tests/test_course.py b/tests/test_course.py
index 888ca59..04aa27b 100644
--- a/tests/test_course.py
+++ b/tests/test_course.py
@@ -302,6 +302,16 @@ class TestCourse(unittest.TestCase):
         self.assertEqual(len(enrollment_list), 4)
         self.assertIsInstance(enrollment_list[0], Enrollment)
 
+    # get_sections()
+    def test_get_sections(self, m):
+        register_uris({'course': ['get_sections', 'get_sections_p2']}, m)
+
+        sections = self.course.get_sections()
+        section_list = [section for section in sections]
+
+        self.assertEqual(len(section_list), 4)
+        self.assertIsInstance(section_list[0], Section)
+
     # get_section
     def test_get_section(self, m):
         register_uris({'course': ['get_section']}, m)
@@ -434,13 +444,15 @@ class TestCourse(unittest.TestCase):
         self.assertEqual(len(tool_list), 4)
 
     def test_list_sections(self, m):
-        register_uris({'course': ['list_sections', 'list_sections2']}, m)
+        register_uris({'course': ['get_sections', 'get_sections_p2']}, m)
 
-        sections = self.course.list_sections()
-        section_list = [sect for sect in sections]
+        with warnings.catch_warnings(record=True) as w:
+            sections = self.course.list_sections()
+            section_list = [sect for sect in sections]
 
-        self.assertIsInstance(section_list[0], Section)
-        self.assertEqual(len(section_list), 4)
+            self.assertEqual(len(section_list), 4)
+            self.assertIsInstance(section_list[0], Section)
+            self.assertTrue(issubclass(w[0].category, DeprecationWarning))
 
     def test_create_course_section(self, m):
         register_uris({'course': ['create_section']}, m)

pip install -e .[dev]
parse_log_pytest
requirements.txt
coverage flake8 pycodestyle pytest
apt-get update apt-get install -y gcc
3.6
requirements.txt dev_requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
attrs==22.2.0
Babel==2.11.0
-e git+https://github.com/ucfopen/canvasapi.git@5a3b536d9cff7d79df58203f64531cf649a6d942#egg=canvasapi
certifi==2021.5.30
charset-normalizer==2.0.12
coverage==6.2
docutils==0.17.1
flake8==5.0.4
idna==3.10
imagesize==1.4.1
importlib-metadata==4.2.0
iniconfig==1.1.1
Jinja2==3.0.3
MarkupSafe==2.0.1
mccabe==0.7.0
packaging==21.3
pluggy==1.0.0
py==1.11.0
pycodestyle==2.9.1
pyflakes==2.5.0
Pygments==2.14.0
pyparsing==3.1.4
pytest==7.0.1
pytz==2025.2
requests==2.27.1
requests-mock==1.12.1
six==1.17.0
snowballstemmer==2.2.0
Sphinx==4.3.2
sphinx-rtd-theme==1.3.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jquery==4.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
tomli==1.2.3
typing_extensions==4.1.1
urllib3==1.26.20
zipp==3.6.0

name: canvasapi
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - attrs==22.2.0
      - babel==2.11.0
      - charset-normalizer==2.0.12
      - coverage==6.2
      - docutils==0.17.1
      - flake8==5.0.4
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.2.0
      - iniconfig==1.1.1
      - jinja2==3.0.3
      - markupsafe==2.0.1
      - mccabe==0.7.0
      - packaging==21.3
      - pluggy==1.0.0
      - py==1.11.0
      - pycodestyle==2.9.1
      - pyflakes==2.5.0
      - pygments==2.14.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - pytz==2025.2
      - requests==2.27.1
      - requests-mock==1.12.1
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==4.3.2
      - sphinx-rtd-theme==1.3.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jquery==4.1
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - zipp==3.6.0
prefix: /opt/conda/envs/canvasapi

tests/test_course.py::TestCourse::test_get_sections
tests/test_course.py::TestCourse::test_list_sections
tests/test_course.py::TestCourse::test__str__ tests/test_course.py::TestCourse::test_add_grading_standards tests/test_course.py::TestCourse::test_add_grading_standards_empty_list tests/test_course.py::TestCourse::test_add_grading_standards_missing_name_key tests/test_course.py::TestCourse::test_add_grading_standards_missing_value_key tests/test_course.py::TestCourse::test_add_grading_standards_non_dict_list tests/test_course.py::TestCourse::test_conclude tests/test_course.py::TestCourse::test_course_files tests/test_course.py::TestCourse::test_create_assignment tests/test_course.py::TestCourse::test_create_assignment_fail tests/test_course.py::TestCourse::test_create_assignment_group tests/test_course.py::TestCourse::test_create_course_section tests/test_course.py::TestCourse::test_create_discussion_topic tests/test_course.py::TestCourse::test_create_external_feed tests/test_course.py::TestCourse::test_create_external_tool tests/test_course.py::TestCourse::test_create_folder tests/test_course.py::TestCourse::test_create_group_category tests/test_course.py::TestCourse::test_create_module tests/test_course.py::TestCourse::test_create_module_fail tests/test_course.py::TestCourse::test_create_page tests/test_course.py::TestCourse::test_create_page_fail tests/test_course.py::TestCourse::test_create_quiz tests/test_course.py::TestCourse::test_create_quiz_fail tests/test_course.py::TestCourse::test_delete tests/test_course.py::TestCourse::test_delete_external_feed tests/test_course.py::TestCourse::test_edit_front_page tests/test_course.py::TestCourse::test_enroll_user tests/test_course.py::TestCourse::test_get_assignment tests/test_course.py::TestCourse::test_get_assignment_group tests/test_course.py::TestCourse::test_get_assignments tests/test_course.py::TestCourse::test_get_course_level_assignment_data tests/test_course.py::TestCourse::test_get_course_level_participation_data tests/test_course.py::TestCourse::test_get_course_level_student_summary_data tests/test_course.py::TestCourse::test_get_discussion_topic tests/test_course.py::TestCourse::test_get_discussion_topics tests/test_course.py::TestCourse::test_get_enrollments tests/test_course.py::TestCourse::test_get_external_tool tests/test_course.py::TestCourse::test_get_external_tools tests/test_course.py::TestCourse::test_get_file tests/test_course.py::TestCourse::test_get_folder tests/test_course.py::TestCourse::test_get_full_discussion_topic tests/test_course.py::TestCourse::test_get_grading_standards tests/test_course.py::TestCourse::test_get_module tests/test_course.py::TestCourse::test_get_modules tests/test_course.py::TestCourse::test_get_outcome_group tests/test_course.py::TestCourse::test_get_outcome_groups_in_context tests/test_course.py::TestCourse::test_get_outcome_links_in_context tests/test_course.py::TestCourse::test_get_outcome_result_rollups tests/test_course.py::TestCourse::test_get_outcome_results tests/test_course.py::TestCourse::test_get_page tests/test_course.py::TestCourse::test_get_pages tests/test_course.py::TestCourse::test_get_quiz tests/test_course.py::TestCourse::test_get_quiz_fail tests/test_course.py::TestCourse::test_get_quizzes tests/test_course.py::TestCourse::test_get_recent_students tests/test_course.py::TestCourse::test_get_root_outcome_group tests/test_course.py::TestCourse::test_get_rubric tests/test_course.py::TestCourse::test_get_section tests/test_course.py::TestCourse::test_get_settings tests/test_course.py::TestCourse::test_get_single_grading_standard tests/test_course.py::TestCourse::test_get_submission tests/test_course.py::TestCourse::test_get_user tests/test_course.py::TestCourse::test_get_user_id_type tests/test_course.py::TestCourse::test_get_user_in_a_course_level_assignment_data tests/test_course.py::TestCourse::test_get_user_in_a_course_level_messaging_data tests/test_course.py::TestCourse::test_get_user_in_a_course_level_participation_data tests/test_course.py::TestCourse::test_get_users tests/test_course.py::TestCourse::test_list_assignment_groups tests/test_course.py::TestCourse::test_list_external_feeds tests/test_course.py::TestCourse::test_list_folders tests/test_course.py::TestCourse::test_list_gradeable_students tests/test_course.py::TestCourse::test_list_group_categories tests/test_course.py::TestCourse::test_list_groups tests/test_course.py::TestCourse::test_list_multiple_submissions tests/test_course.py::TestCourse::test_list_multiple_submissions_grouped_param tests/test_course.py::TestCourse::test_list_rubrics tests/test_course.py::TestCourse::test_list_submissions tests/test_course.py::TestCourse::test_list_tabs tests/test_course.py::TestCourse::test_mark_submission_as_read tests/test_course.py::TestCourse::test_mark_submission_as_unread tests/test_course.py::TestCourse::test_preview_html tests/test_course.py::TestCourse::test_reorder_pinned_topics tests/test_course.py::TestCourse::test_reorder_pinned_topics_comma_separated_string tests/test_course.py::TestCourse::test_reorder_pinned_topics_invalid_input tests/test_course.py::TestCourse::test_reorder_pinned_topics_tuple tests/test_course.py::TestCourse::test_reset tests/test_course.py::TestCourse::test_show_front_page tests/test_course.py::TestCourse::test_subit_assignment_fail tests/test_course.py::TestCourse::test_submit_assignment tests/test_course.py::TestCourse::test_update tests/test_course.py::TestCourse::test_update_settings tests/test_course.py::TestCourse::test_update_submission tests/test_course.py::TestCourse::test_update_tab tests/test_course.py::TestCourse::test_upload tests/test_course.py::TestCourseNickname::test__str__ tests/test_course.py::TestCourseNickname::test_remove
canvasapi/course.py
canvasapi/course.py