##// END OF EJS Templates
Robustness fixes in test suite machinery....
Robustness fixes in test suite machinery. Added a module-level INSTALLED flag, which can be set to false if the test suite is being run in-place (without ipython having been installed at all). This is because how we call and import things must be done differently depending on whether the code is installed or is being run in-place. The only ones that can know this reliably are the entry-point scripts, so those are responsible for setting this flag. Also made the code that validates ipython in subprocesses report errors better, by checking stderr for errors before validating stdout output, as anything on stderr will be likely informative of the real problem.

File last commit:

r2494:c8938204
r2494:c8938204
Show More
tclass.py
31 lines | 848 B | text/x-python | PythonLexer
"""Simple script to be run *twice*, to check reference counting bugs.
See test_run for details."""
import sys
# We want to ensure that while objects remain available for immediate access,
# objects from *previous* runs of the same script get collected, to avoid
# accumulating massive amounts of old references.
class C(object):
def __init__(self,name):
self.name = name
def __del__(self):
print 'tclass.py: deleting object:',self.name
sys.stdout.flush()
try:
name = sys.argv[1]
except IndexError:
pass
else:
if name.startswith('C'):
c = C(name)
#print >> sys.stderr, "ARGV:", sys.argv # dbg
# This next print statement is NOT debugging, we're making the check on a
# completely separate process so we verify by capturing stdout:
print 'ARGV 1-:', sys.argv[1:]
sys.stdout.flush()