mirror of
				https://github.com/django/django.git
				synced 2025-10-30 17:16:10 +00:00 
			
		
		
		
	Fixed #36479 -- Improved how FileNotFoundError is triggered in code formatter tests.
Ensured the test for formatter subprocess FileNotFoundError doesn't rely on platform-specific behavior, improving reliability on macOS and other systems by consistently using pathlib to build test paths.
This commit is contained in:
		
				
					committed by
					
						 nessita
						nessita
					
				
			
			
				
	
			
			
			
						parent
						
							192bc7a7be
						
					
				
				
					commit
					58fc40427f
				
			| @@ -565,11 +565,15 @@ class UtilsTests(SimpleTestCase): | ||||
|         self.assertEqual(normalize_path_patterns(["foo/bar/*", "bar/*/"]), expected) | ||||
|  | ||||
|     def test_run_formatters_handles_oserror_for_black_path(self): | ||||
|         test_files_path = Path(__file__).parent / "test_files" | ||||
|         cases = [ | ||||
|             (FileNotFoundError, "nonexistent"), | ||||
|             ( | ||||
|                 FileNotFoundError, | ||||
|                 str(test_files_path / "nonexistent"), | ||||
|             ), | ||||
|             ( | ||||
|                 OSError if sys.platform == "win32" else PermissionError, | ||||
|                 str(Path(__file__).parent / "test_files" / "black"), | ||||
|                 str(test_files_path / "black"), | ||||
|             ), | ||||
|         ] | ||||
|         for exception, location in cases: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user