mirror of
				https://github.com/python/cpython.git
				synced 2025-10-30 21:21:22 +00:00 
			
		
		
		
	Clean up some warnings in test suite output.
This commit is contained in:
		
							parent
							
								
									ba3e4a0bc0
								
							
						
					
					
						commit
						6d70870812
					
				
					 2 changed files with 6 additions and 5 deletions
				
			
		|  | @ -8,7 +8,7 @@ | ||||||
| import errno | import errno | ||||||
| 
 | 
 | ||||||
| from test.support import (TESTFN, unlink, run_unittest, captured_output, | from test.support import (TESTFN, unlink, run_unittest, captured_output, | ||||||
|                           gc_collect, cpython_only, no_tracing) |                           check_warnings, gc_collect, cpython_only, no_tracing) | ||||||
| 
 | 
 | ||||||
| class NaiveException(Exception): | class NaiveException(Exception): | ||||||
|     def __init__(self, x): |     def __init__(self, x): | ||||||
|  | @ -939,6 +939,7 @@ def test_attributes(self): | ||||||
| 
 | 
 | ||||||
|     def test_non_str_argument(self): |     def test_non_str_argument(self): | ||||||
|         # Issue #15778 |         # Issue #15778 | ||||||
|  |         with check_warnings(('', BytesWarning), quiet=True): | ||||||
|             arg = b'abc' |             arg = b'abc' | ||||||
|             exc = ImportError(arg) |             exc = ImportError(arg) | ||||||
|             self.assertEqual(str(arg), str(exc)) |             self.assertEqual(str(arg), str(exc)) | ||||||
|  |  | ||||||
|  | @ -80,7 +80,7 @@ def module_code(): | ||||||
|             with util.import_state(meta_path=[importer]): |             with util.import_state(meta_path=[importer]): | ||||||
|                 with self.assertRaises(ImportError) as exc: |                 with self.assertRaises(ImportError) as exc: | ||||||
|                     import_util.import_('pkg', fromlist=['mod']) |                     import_util.import_('pkg', fromlist=['mod']) | ||||||
|                 self.assertEquals('i_do_not_exist', exc.exception.name) |                 self.assertEqual('i_do_not_exist', exc.exception.name) | ||||||
| 
 | 
 | ||||||
|     def test_empty_string(self): |     def test_empty_string(self): | ||||||
|         with util.mock_modules('pkg.__init__', 'pkg.mod') as importer: |         with util.mock_modules('pkg.__init__', 'pkg.mod') as importer: | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Nadeem Vawda
						Nadeem Vawda