diff options
author | Steven Knight <knight@baldmt.com> | 2010-04-19 02:28:06 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2010-04-19 02:28:06 (GMT) |
commit | f1049d9db2e71842802f89b708ba825df304e774 (patch) | |
tree | 17b7ed783aafcd8fdb28147b1bbe621bf4d3f9a4 /test | |
parent | 391aabed467e2b5d88c13462851fef981cd8c44d (diff) | |
download | SCons-f1049d9db2e71842802f89b708ba825df304e774.zip SCons-f1049d9db2e71842802f89b708ba825df304e774.tar.gz SCons-f1049d9db2e71842802f89b708ba825df304e774.tar.bz2 |
Remove use of the "new" module from --debug=memoizer support.
Diffstat (limited to 'test')
-rw-r--r-- | test/option/debug-memoizer.py | 50 |
1 files changed, 6 insertions, 44 deletions
diff --git a/test/option/debug-memoizer.py b/test/option/debug-memoizer.py index f8e4cc3..222ba67 100644 --- a/test/option/debug-memoizer.py +++ b/test/option/debug-memoizer.py @@ -29,33 +29,11 @@ Test calling the --debug=memoizer option. """ import os -import new + import TestSCons test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) -# Find out if we support metaclasses (Python 2.2 and later). - -class M: - def __init__(cls, name, bases, cls_dict): - cls.use_metaclass = 1 - def fake_method(self): - pass - new.instancemethod(fake_method, None, cls) - -try: - class A: - __metaclass__ = M - - use_metaclass = A.use_metaclass -except AttributeError: - use_metaclass = None - reason = 'no metaclasses' -except TypeError: - use_metaclass = None - reason = 'new.instancemethod\\(\\) bug' - - test.write('SConstruct', """ def cat(target, source, env): @@ -79,27 +57,9 @@ expect = [ ] -if use_metaclass: - - def run_and_check(test, args, desc): - test.run(arguments = args) - test.must_contain_any_line(test.stdout(), expect) - -else: - - expect_no_metaclasses = """ -scons: warning: memoization is not supported in this version of Python \\(%s\\) -""" % reason - - expect_no_metaclasses = expect_no_metaclasses + TestSCons.file_expr - - def run_and_check(test, args, desc): - test.run(arguments = args, stderr = expect_no_metaclasses) - test.must_not_contain_any_line(test.stdout(), expect) - - for args in ['-h --debug=memoizer', '--debug=memoizer']: - run_and_check(test, args, "command line '%s'" % args) + test.run(arguments = args) + test.must_contain_any_line(test.stdout(), expect) test.must_match('file.out', "file.in\n") @@ -111,7 +71,9 @@ test.unlink("file.out") os.environ['SCONSFLAGS'] = '--debug=memoizer' -run_and_check(test, '', 'SCONSFLAGS=--debug=memoizer') +test.run(arguments = '') + +test.must_contain_any_line(test.stdout(), expect) test.must_match('file.out', "file.in\n") |