@@ -37,10 +37,12 @@ def test_for_name_does_not_exist(self):
3737 Distribution .from_name ('does-not-exist' )
3838
3939 def test_package_not_found_mentions_metadata (self ):
40- # When a package is not found, that could indicate that the
41- # packgae is not installed or that it is installed without
42- # metadata. Ensure the exception mentions metadata to help
43- # guide users toward the cause. See #124.
40+ """
41+ When a package is not found, that could indicate that the
42+ packgae is not installed or that it is installed without
43+ metadata. Ensure the exception mentions metadata to help
44+ guide users toward the cause. See #124.
45+ """
4446 with self .assertRaises (PackageNotFoundError ) as ctx :
4547 Distribution .from_name ('does-not-exist' )
4648
@@ -89,8 +91,10 @@ def pkg_with_dashes(site_dir):
8991 return 'my-pkg'
9092
9193 def test_dashes_in_dist_name_found_as_underscores (self ):
92- # For a package with a dash in the name, the dist-info metadata
93- # uses underscores in the name. Ensure the metadata loads.
94+ """
95+ For a package with a dash in the name, the dist-info metadata
96+ uses underscores in the name. Ensure the metadata loads.
97+ """
9498 pkg_name = self .pkg_with_dashes (self .site_dir )
9599 assert version (pkg_name ) == '1.0'
96100
@@ -108,7 +112,9 @@ def pkg_with_mixed_case(site_dir):
108112 return 'CherryPy'
109113
110114 def test_dist_name_found_as_any_case (self ):
111- # Ensure the metadata loads when queried with any case.
115+ """
116+ Ensure the metadata loads when queried with any case.
117+ """
112118 pkg_name = self .pkg_with_mixed_case (self .site_dir )
113119 assert version (pkg_name ) == '1.0'
114120 assert version (pkg_name .lower ()) == '1.0'
@@ -244,11 +250,13 @@ def test_repr(self):
244250 assert "'name'" in repr (self .ep )
245251
246252 def test_hashable (self ):
247- # EntryPoints should be hashable.
253+ """ EntryPoints should be hashable"""
248254 hash (self .ep )
249255
250256 def test_json_dump (self ):
251- # json should not expect to be able to dump an EntryPoint.
257+ """
258+ json should not expect to be able to dump an EntryPoint
259+ """
252260 with self .assertRaises (Exception ):
253261 with warnings .catch_warnings (record = True ):
254262 json .dumps (self .ep )
@@ -260,7 +268,9 @@ def test_attr(self):
260268 assert self .ep .attr is None
261269
262270 def test_sortable (self ):
263- # EntryPoint objects are sortable, but result is undefined.
271+ """
272+ EntryPoint objects are sortable, but result is undefined.
273+ """
264274 sorted (
265275 [
266276 EntryPoint (name = 'b' , value = 'val' , group = 'group' ),
@@ -273,8 +283,10 @@ class FileSystem(
273283 fixtures .OnSysPath , fixtures .SiteDir , fixtures .FileBuilder , unittest .TestCase
274284):
275285 def test_unicode_dir_on_sys_path (self ):
276- # Ensure a Unicode subdirectory of a directory on sys.path
277- # does not crash.
286+ """
287+ Ensure a Unicode subdirectory of a directory on sys.path
288+ does not crash.
289+ """
278290 fixtures .build_files (
279291 {self .unicode_filename (): {}},
280292 prefix = self .site_dir ,
0 commit comments