mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	move this test to test_descr; it's not abc specific
This commit is contained in:
		
							parent
							
								
									1efb8dc871
								
							
						
					
					
						commit
						1c02a44023
					
				
					 2 changed files with 7 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -98,13 +98,6 @@ def bar(self): pass  # abstract override of concrete
 | 
			
		|||
            self.assertRaises(TypeError, F)  # because bar is abstract now
 | 
			
		||||
            self.assertTrue(isabstract(F))
 | 
			
		||||
 | 
			
		||||
    def test_type_has_no_abstractmethods(self):
 | 
			
		||||
        # type pretends not to have __abstractmethods__.
 | 
			
		||||
        self.assertRaises(AttributeError, getattr, type, "__abstractmethods__")
 | 
			
		||||
        class meta(type):
 | 
			
		||||
            pass
 | 
			
		||||
        self.assertRaises(AttributeError, getattr, meta, "__abstractmethods__")
 | 
			
		||||
 | 
			
		||||
    def test_metaclass_abc(self):
 | 
			
		||||
        # Metaclasses can be ABCs, too.
 | 
			
		||||
        class A(metaclass=abc.ABCMeta):
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4273,6 +4273,13 @@ def test_repr(self):
 | 
			
		|||
        dict_ = {k: v for k, v in self.C.__dict__.items()}
 | 
			
		||||
        self.assertEqual(repr(self.C.__dict__), 'dict_proxy({!r})'.format(dict_))
 | 
			
		||||
 | 
			
		||||
    def test_type_has_no_abstractmethods(self):
 | 
			
		||||
        # type pretends not to have __abstractmethods__.
 | 
			
		||||
        self.assertRaises(AttributeError, getattr, type, "__abstractmethods__")
 | 
			
		||||
        class meta(type):
 | 
			
		||||
            pass
 | 
			
		||||
        self.assertRaises(AttributeError, getattr, meta, "__abstractmethods__")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class PTypesLongInitTest(unittest.TestCase):
 | 
			
		||||
    # This is in its own TestCase so that it can be run before any other tests.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue