mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	bpo-43672: raise ImportWarning when calling find_loader() (GH-25119)
This commit is contained in:
		
							parent
							
								
									ad442a674c
								
							
						
					
					
						commit
						f97dc80068
					
				
					 13 changed files with 610 additions and 616 deletions
				
			
		|  | @ -81,10 +81,8 @@ def test_entry_points_distribution(self): | |||
|             self.assertEqual(ep.dist.version, "1.0.0") | ||||
| 
 | ||||
|     def test_entry_points_unique_packages(self): | ||||
|         """ | ||||
|         Entry points should only be exposed for the first package | ||||
|         on sys.path with a given name. | ||||
|         """ | ||||
|         # Entry points should only be exposed for the first package | ||||
|         # on sys.path with a given name. | ||||
|         alt_site_dir = self.fixtures.enter_context(fixtures.tempdir()) | ||||
|         self.fixtures.enter_context(self.add_sys_path(alt_site_dir)) | ||||
|         alt_pkg = { | ||||
|  | @ -116,11 +114,9 @@ def test_entry_points_missing_group(self): | |||
|         assert entry_points(group='missing') == () | ||||
| 
 | ||||
|     def test_entry_points_dict_construction(self): | ||||
|         """ | ||||
|         Prior versions of entry_points() returned simple lists and | ||||
|         allowed casting those lists into maps by name using ``dict()``. | ||||
|         Capture this now deprecated use-case. | ||||
|         """ | ||||
|         # Prior versions of entry_points() returned simple lists and | ||||
|         # allowed casting those lists into maps by name using ``dict()``. | ||||
|         # Capture this now deprecated use-case. | ||||
|         with warnings.catch_warnings(record=True) as caught: | ||||
|             warnings.filterwarnings("default", category=DeprecationWarning) | ||||
|             eps = dict(entry_points(group='entries')) | ||||
|  | @ -134,11 +130,9 @@ def test_entry_points_dict_construction(self): | |||
|         assert "Construction of dict of EntryPoints is deprecated" in str(expected) | ||||
| 
 | ||||
|     def test_entry_points_groups_getitem(self): | ||||
|         """ | ||||
|         Prior versions of entry_points() returned a dict. Ensure | ||||
|         that callers using '.__getitem__()' are supported but warned to | ||||
|         migrate. | ||||
|         """ | ||||
|         # Prior versions of entry_points() returned a dict. Ensure | ||||
|         # that callers using '.__getitem__()' are supported but warned to | ||||
|         # migrate. | ||||
|         with warnings.catch_warnings(record=True): | ||||
|             entry_points()['entries'] == entry_points(group='entries') | ||||
| 
 | ||||
|  | @ -146,11 +140,9 @@ def test_entry_points_groups_getitem(self): | |||
|                 entry_points()['missing'] | ||||
| 
 | ||||
|     def test_entry_points_groups_get(self): | ||||
|         """ | ||||
|         Prior versions of entry_points() returned a dict. Ensure | ||||
|         that callers using '.get()' are supported but warned to | ||||
|         migrate. | ||||
|         """ | ||||
|         # Prior versions of entry_points() returned a dict. Ensure | ||||
|         # that callers using '.get()' are supported but warned to | ||||
|         # migrate. | ||||
|         with warnings.catch_warnings(record=True): | ||||
|             entry_points().get('missing', 'default') == 'default' | ||||
|             entry_points().get('entries', 'default') == entry_points()['entries'] | ||||
|  | @ -259,7 +251,7 @@ def test_find_distributions_specified_path(self): | |||
|         assert any(dist.metadata['Name'] == 'distinfo-pkg' for dist in dists) | ||||
| 
 | ||||
|     def test_distribution_at_pathlib(self): | ||||
|         """Demonstrate how to load metadata direct from a directory.""" | ||||
|         # Demonstrate how to load metadata direct from a directory. | ||||
|         dist_info_path = self.site_dir / 'distinfo_pkg-1.0.0.dist-info' | ||||
|         dist = Distribution.at(dist_info_path) | ||||
|         assert dist.version == '1.0.0' | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Brett Cannon
						Brett Cannon