mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Applying patch #100994 to allow JPython to use more of the standard
Python test suite. Specifically, - import time instead of strop in test_b1 - test for ClassType of exceptions using isinstance instead of equality in test_exceptions - remove __builtins__ from dir() output in test_pkg test_pkg output needs to be regenerated.
This commit is contained in:
parent
736aa32a39
commit
3a9d0611fb
4 changed files with 19 additions and 12 deletions
|
@ -26,15 +26,15 @@ t5.foo loading
|
||||||
t5.string loading
|
t5.string loading
|
||||||
1
|
1
|
||||||
['foo', 'string', 't5']
|
['foo', 'string', 't5']
|
||||||
['__builtins__', '__doc__', '__file__', '__name__', '__path__', 'foo', 'string', 't5']
|
['__doc__', '__file__', '__name__', '__path__', 'foo', 'string', 't5']
|
||||||
['__builtins__', '__doc__', '__file__', '__name__', 'string']
|
['__doc__', '__file__', '__name__', 'string']
|
||||||
['__builtins__', '__doc__', '__file__', '__name__', 'spam']
|
['__doc__', '__file__', '__name__', 'spam']
|
||||||
running test t6
|
running test t6
|
||||||
['__all__', '__builtins__', '__doc__', '__file__', '__name__', '__path__']
|
['__all__', '__doc__', '__file__', '__name__', '__path__']
|
||||||
t6.spam loading
|
t6.spam loading
|
||||||
t6.ham loading
|
t6.ham loading
|
||||||
t6.eggs loading
|
t6.eggs loading
|
||||||
['__all__', '__builtins__', '__doc__', '__file__', '__name__', '__path__', 'eggs', 'ham', 'spam']
|
['__all__', '__doc__', '__file__', '__name__', '__path__', 'eggs', 'ham', 'spam']
|
||||||
['eggs', 'ham', 'spam', 't6']
|
['eggs', 'ham', 'spam', 't6']
|
||||||
running test t7
|
running test t7
|
||||||
t7 loading
|
t7 loading
|
||||||
|
|
|
@ -4,7 +4,7 @@ from test_support import *
|
||||||
|
|
||||||
print '__import__'
|
print '__import__'
|
||||||
__import__('sys')
|
__import__('sys')
|
||||||
__import__('strop')
|
__import__('time')
|
||||||
__import__('string')
|
__import__('string')
|
||||||
try: __import__('spamspam')
|
try: __import__('spamspam')
|
||||||
except ImportError: pass
|
except ImportError: pass
|
||||||
|
|
|
@ -19,7 +19,7 @@ def test_raise_catch(exc):
|
||||||
|
|
||||||
def r(thing):
|
def r(thing):
|
||||||
test_raise_catch(thing)
|
test_raise_catch(thing)
|
||||||
if type(thing) == ClassType:
|
if isinstance(thing, ClassType):
|
||||||
print thing.__name__
|
print thing.__name__
|
||||||
else:
|
else:
|
||||||
print thing
|
print thing
|
||||||
|
|
|
@ -42,6 +42,13 @@ def rmdir(x):
|
||||||
if verbose: print "rmdir", x
|
if verbose: print "rmdir", x
|
||||||
os.rmdir(x)
|
os.rmdir(x)
|
||||||
|
|
||||||
|
def fixdir(lst):
|
||||||
|
try:
|
||||||
|
lst.remove('__builtins__')
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
|
return lst
|
||||||
|
|
||||||
# Helper to run a test
|
# Helper to run a test
|
||||||
|
|
||||||
def runtest(hier, code):
|
def runtest(hier, code):
|
||||||
|
@ -146,9 +153,9 @@ import t5
|
||||||
from t5 import *
|
from t5 import *
|
||||||
print dir()
|
print dir()
|
||||||
import t5
|
import t5
|
||||||
print dir(t5)
|
print fixdir(dir(t5))
|
||||||
print dir(t5.foo)
|
print fixdir(dir(t5.foo))
|
||||||
print dir(t5.string)
|
print fixdir(dir(t5.string))
|
||||||
"""),
|
"""),
|
||||||
|
|
||||||
("t6", [
|
("t6", [
|
||||||
|
@ -160,9 +167,9 @@ print dir(t5.string)
|
||||||
],
|
],
|
||||||
"""
|
"""
|
||||||
import t6
|
import t6
|
||||||
print dir(t6)
|
print fixdir(dir(t6))
|
||||||
from t6 import *
|
from t6 import *
|
||||||
print dir(t6)
|
print fixdir(dir(t6))
|
||||||
print dir()
|
print dir()
|
||||||
"""),
|
"""),
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue