From: Dag Sverre Seljebotn <dagss@student.matnat.uio.no>
Date: Mon, 5 Oct 2009 13:08:16 +0000 (+0200)
Subject: Rename doctesthack -> autotestdict, and make it default
X-Git-Tag: 0.13.beta0~2^2~123^2~3
X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a3671c67a5cf63bc1b4804d58cf7b5fecc8f46bd;p=cython.git

Rename doctesthack -> autotestdict, and make it default

--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
---

diff --git a/Cython/Compiler/AnalysedTreeTransforms.py b/Cython/Compiler/AnalysedTreeTransforms.py
index b8f45086..25ccf404 100644
--- a/Cython/Compiler/AnalysedTreeTransforms.py
+++ b/Cython/Compiler/AnalysedTreeTransforms.py
@@ -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
diff --git a/Cython/Compiler/Main.py b/Cython/Compiler/Main.py
index 05bde200..766dea58 100644
--- a/Cython/Compiler/Main.py
+++ b/Cython/Compiler/Main.py
@@ -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),
diff --git a/Cython/Compiler/Options.py b/Cython/Compiler/Options.py
index 0739f249..86b1c64b 100644
--- a/Cython/Compiler/Options.py
+++ b/Cython/Compiler/Options.py
@@ -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):
diff --git a/tests/errors/e_doctesthack.pyx b/tests/errors/e_autotestdict.pyx
similarity index 100%
rename from tests/errors/e_doctesthack.pyx
rename to tests/errors/e_autotestdict.pyx
diff --git a/tests/run/doctesthack.pyx b/tests/run/autotestdict.pyx
similarity index 100%
rename from tests/run/doctesthack.pyx
rename to tests/run/autotestdict.pyx
diff --git a/tests/run/doctesthack_skip.pyx b/tests/run/autotestdict_skip.pyx
similarity index 100%
rename from tests/run/doctesthack_skip.pyx
rename to tests/run/autotestdict_skip.pyx