Commits

William Deegan committed 1d5154a

Steven checked in some changes yesterday which fixed a great number of
failing tests by setting SCONSFLAGS='-warn=no-python-version' in def
run() in TestSCons.py yesterday, where previously it was done in def
__init__(...).

This fixed most of the broken tests, but broke some of the working tests.
I readded the logic to def __init__

In addition I've added an extra arg to the __init__ for TestSCons.py
ignore_python_version (which defaults to true).
For those tests which need to be able to see the deprecation and/or
test the functionality of the deprecation.

Comments (0)

Files changed (3)

QMTest/TestSCons.py

         # control character output on FC8
         # TERM can cause test failures due to control chars in prompts etc.
         os.environ['TERM'] = 'dumb'
+        
+        self.ignore_python_version=kw.get('ignore_python_version',1)
+        if kw.get('ignore_python_version',-1) != -1:
+            del kw['ignore_python_version']
+
+        if self.ignore_python_version and deprecated_python_version():
+            sconsflags = os.environ.get('SCONSFLAGS')
+            if sconsflags:
+                sconsflags = [sconsflags]
+            else:
+                sconsflags = []
+            sconsflags = sconsflags + ['--warn=no-python-version']
+            os.environ['SCONSFLAGS'] = string.join(sconsflags)
 
         apply(TestCommon.__init__, [self], kw)
 
         deprecation warnings.
         """
         save_sconsflags = os.environ.get('SCONSFLAGS')
-        if deprecated_python_version():
+        if self.ignore_python_version and deprecated_python_version():
             if save_sconsflags:
                 sconsflags = [save_sconsflags]
             else:

test/SCONSFLAGS.py

 import TestCmd
 import TestSCons
 
-test = TestSCons.TestSCons(match = TestCmd.match_re_dotall)
+test = TestSCons.TestSCons(match = TestCmd.match_re_dotall,ignore_python_version=0)
 
 wpath = test.workpath()
 

test/python-version.py

 import TestCmd
 import TestSCons
 
-test = TestSCons.TestSCons(match = TestCmd.match_re_dotall)
+test = TestSCons.TestSCons(match = TestCmd.match_re_dotall,ignore_python_version=0)
 
 test.write('SConstruct', "\n")
 
 
     if TestSCons.deprecated_python_version():
 
-        sconsflags = os.environ.get('SCONSFLAGS')
-        if sconsflags:
-            sconsflags = string.replace(sconsflags, '--warn=no-python-version', '')
-            os.environ['SCONSFLAGS'] = sconsflags
-
         test.run(arguments = '-Q', stderr = TestSCons.deprecated_python_expr)
 
     else: