[pypy-svn] rev 2633 - pypy/trunk/src/pypy/tool
sschwarzer at codespeak.net
sschwarzer at codespeak.net
Sat Dec 20 11:59:26 CET 2003
Author: sschwarzer
Date: Sat Dec 20 11:59:26 2003
New Revision: 2633
Modified:
pypy/trunk/src/pypy/tool/newtest.py
Log:
newtest.main now works as expected.
Modified: pypy/trunk/src/pypy/tool/newtest.py
==============================================================================
--- pypy/trunk/src/pypy/tool/newtest.py (original)
+++ pypy/trunk/src/pypy/tool/newtest.py Sat Dec 20 11:59:26 2003
@@ -428,7 +428,7 @@
Else, the __main__ module will be used.
"""
if module is None:
- module = sys.modules['__main__']
+ module = __import__('__main__')
items = []
# scan the values for test functions, and for classes derived
# from TestCase
@@ -586,10 +586,10 @@
Find all tests in the current module (i. e. the module from which this
function is called), execute them and print results.
"""
+ import __main__
from pypy.tool import newtest
suite = TestSuite()
- print globals()
- suite.init_from_dict(globals())
+ suite.init_from_dict(vars(__main__))
_print_results(suite)
def test(do_selftest=False):
More information about the Pypy-commit
mailing list