Rename doctesthack -> autotestdict, and make it default
authorDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Mon, 5 Oct 2009 13:08:16 +0000 (15:08 +0200)
committerDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Mon, 5 Oct 2009 13:08:16 +0000 (15:08 +0200)
--HG--
rename : tests/errors/e_doctesthack.pyx => tests/errors/e_autotestdict.pyx
rename : tests/run/doctesthack.pyx => tests/run/autotestdict.pyx
rename : tests/run/doctesthack_skip.pyx => tests/run/autotestdict_skip.pyx

Cython/Compiler/AnalysedTreeTransforms.py
Cython/Compiler/Main.py
Cython/Compiler/Options.py
tests/errors/e_autotestdict.pyx [moved from tests/errors/e_doctesthack.pyx with 100% similarity]
tests/run/autotestdict.pyx [moved from tests/run/doctesthack.pyx with 100% similarity]
tests/run/autotestdict_skip.pyx [moved from tests/run/doctesthack_skip.pyx with 100% similarity]

index b8f45086fce4aa81af089ec3837a0f528e48d59e..25ccf404dbf0299159938b358ee7e2888fb76b82 100644 (file)
@@ -7,13 +7,13 @@ from Builtin import dict_type
 from StringEncoding import EncodedString
 import Naming
 
-class DoctestHackTransform(ScopeTrackingTransform):
-    # Handles doctesthack directive
+class AutoTestDictTransform(ScopeTrackingTransform):
+    # Handles autotestdict directive
 
     def visit_ModuleNode(self, node):
         self.scope_type = 'module'
         self.scope_node = node
-        if self.current_directives['doctesthack']:
+        if self.current_directives['autotestdict']:
             assert isinstance(node.body, StatListNode)
 
             # First see if __test__ is already created
index 05bde200be9c36f2f8299b6e6e9aba9d8c4f96eb..766dea585f395440996576c249c7eb801fb92d54 100644 (file)
@@ -88,7 +88,7 @@ class Context(object):
         from ParseTreeTransforms import CreateClosureClasses, MarkClosureVisitor, DecoratorTransform
         from ParseTreeTransforms import InterpretCompilerDirectives, TransformBuiltinMethods
         from ParseTreeTransforms import AlignFunctionDefinitions, GilCheck
-        from AnalysedTreeTransforms import DoctestHackTransform
+        from AnalysedTreeTransforms import AutoTestDictTransform
         from AutoDocTransforms import EmbedSignature
         from Optimize import FlattenInListTransform, SwitchTransform, IterationTransform
         from Optimize import OptimizeBuiltinCalls, ConstantFolding, FinalOptimizePhase
@@ -127,7 +127,7 @@ class Context(object):
             WithTransform(self),
             DecoratorTransform(self),
             AnalyseDeclarationsTransform(self),
-            DoctestHackTransform(self),
+            AutoTestDictTransform(self),
             EmbedSignature(self),
             TransformBuiltinMethods(self),
             IntroduceBufferAuxiliaryVars(self),
index 0739f2498012a383c949be401bdc2f6fd1faa7ba..86b1c64ba683902b18f3b48234705ac2343c3f18 100644 (file)
@@ -68,7 +68,7 @@ option_defaults = {
     'c99_complex' : False, # Don't use macro wrappers for complex arith, not sure what to name this...
     'callspec' : "",
     'profile': False,
-    'doctesthack': False
+    'autotestdict': True
 }
 
 # Override types possibilities above, if needed
@@ -80,7 +80,7 @@ for key, val in option_defaults.items():
 
 option_scopes = { # defaults to available everywhere
     # 'module', 'function', 'class', 'with statement'
-    'doctesthack' : ('module',)
+    'autotestdict' : ('module',)
 }
 
 def parse_option_value(name, value):