@@ -37,10 +37,12 @@ def test_for_name_does_not_exist(self):
37
37
Distribution .from_name ('does-not-exist' )
38
38
39
39
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
+ """
44
46
with self .assertRaises (PackageNotFoundError ) as ctx :
45
47
Distribution .from_name ('does-not-exist' )
46
48
@@ -89,8 +91,10 @@ def pkg_with_dashes(site_dir):
89
91
return 'my-pkg'
90
92
91
93
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
+ """
94
98
pkg_name = self .pkg_with_dashes (self .site_dir )
95
99
assert version (pkg_name ) == '1.0'
96
100
@@ -108,7 +112,9 @@ def pkg_with_mixed_case(site_dir):
108
112
return 'CherryPy'
109
113
110
114
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
+ """
112
118
pkg_name = self .pkg_with_mixed_case (self .site_dir )
113
119
assert version (pkg_name ) == '1.0'
114
120
assert version (pkg_name .lower ()) == '1.0'
@@ -244,11 +250,13 @@ def test_repr(self):
244
250
assert "'name'" in repr (self .ep )
245
251
246
252
def test_hashable (self ):
247
- # EntryPoints should be hashable.
253
+ """ EntryPoints should be hashable"""
248
254
hash (self .ep )
249
255
250
256
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
+ """
252
260
with self .assertRaises (Exception ):
253
261
with warnings .catch_warnings (record = True ):
254
262
json .dumps (self .ep )
@@ -260,7 +268,9 @@ def test_attr(self):
260
268
assert self .ep .attr is None
261
269
262
270
def test_sortable (self ):
263
- # EntryPoint objects are sortable, but result is undefined.
271
+ """
272
+ EntryPoint objects are sortable, but result is undefined.
273
+ """
264
274
sorted (
265
275
[
266
276
EntryPoint (name = 'b' , value = 'val' , group = 'group' ),
@@ -273,8 +283,10 @@ class FileSystem(
273
283
fixtures .OnSysPath , fixtures .SiteDir , fixtures .FileBuilder , unittest .TestCase
274
284
):
275
285
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
+ """
278
290
fixtures .build_files (
279
291
{self .unicode_filename (): {}},
280
292
prefix = self .site_dir ,
0 commit comments