mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Implement PEP 366
This commit is contained in:
		
							parent
							
								
									f19b951126
								
							
						
					
					
						commit
						ef01d822aa
					
				
					 7 changed files with 212 additions and 81 deletions
				
			
		|  | @ -188,11 +188,13 @@ def test_5(self): | |||
|         import t5 | ||||
|         self.assertEqual(fixdir(dir(t5)), | ||||
|                          ['__doc__', '__file__', '__name__', | ||||
|                           '__path__', 'foo', 'string', 't5']) | ||||
|                           '__package__', '__path__', 'foo', 'string', 't5']) | ||||
|         self.assertEqual(fixdir(dir(t5.foo)), | ||||
|                          ['__doc__', '__file__', '__name__', 'string']) | ||||
|                          ['__doc__', '__file__', '__name__', '__package__', | ||||
|                           'string']) | ||||
|         self.assertEqual(fixdir(dir(t5.string)), | ||||
|                          ['__doc__', '__file__', '__name__', 'spam']) | ||||
|                          ['__doc__', '__file__', '__name__','__package__', | ||||
|                           'spam']) | ||||
| 
 | ||||
|     def test_6(self): | ||||
|         hier = [ | ||||
|  | @ -208,14 +210,14 @@ def test_6(self): | |||
|         import t6 | ||||
|         self.assertEqual(fixdir(dir(t6)), | ||||
|                          ['__all__', '__doc__', '__file__', | ||||
|                           '__name__', '__path__']) | ||||
|                           '__name__', '__package__', '__path__']) | ||||
|         s = """ | ||||
|             import t6 | ||||
|             from t6 import * | ||||
|             self.assertEqual(fixdir(dir(t6)), | ||||
|                              ['__all__', '__doc__', '__file__', | ||||
|                               '__name__', '__path__', 'eggs', | ||||
|                               'ham', 'spam']) | ||||
|                               '__name__', '__package__', '__path__', | ||||
|                               'eggs', 'ham', 'spam']) | ||||
|             self.assertEqual(dir(), ['eggs', 'ham', 'self', 'spam', 't6']) | ||||
|             """ | ||||
|         self.run_code(s) | ||||
|  | @ -241,17 +243,19 @@ def test_7(self): | |||
|         t7, sub, subsub = None, None, None | ||||
|         import t7 as tas | ||||
|         self.assertEqual(fixdir(dir(tas)), | ||||
|                          ['__doc__', '__file__', '__name__', '__path__']) | ||||
|                          ['__doc__', '__file__', '__name__', | ||||
|                           '__package__', '__path__']) | ||||
|         self.failIf(t7) | ||||
|         from t7 import sub as subpar | ||||
|         self.assertEqual(fixdir(dir(subpar)), | ||||
|                          ['__doc__', '__file__', '__name__', '__path__']) | ||||
|                          ['__doc__', '__file__', '__name__', | ||||
|                           '__package__', '__path__']) | ||||
|         self.failIf(t7) | ||||
|         self.failIf(sub) | ||||
|         from t7.sub import subsub as subsubsub | ||||
|         self.assertEqual(fixdir(dir(subsubsub)), | ||||
|                          ['__doc__', '__file__', '__name__', '__path__', | ||||
|                           'spam']) | ||||
|                          ['__doc__', '__file__', '__name__', | ||||
|                          '__package__', '__path__', 'spam']) | ||||
|         self.failIf(t7) | ||||
|         self.failIf(sub) | ||||
|         self.failIf(subsub) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Nick Coghlan
						Nick Coghlan