Commit a3671c67 authored by Dag Sverre Seljebotn's avatar Dag Sverre Seljebotn

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
parent 3f00253b
...@@ -7,13 +7,13 @@ from Builtin import dict_type ...@@ -7,13 +7,13 @@ from Builtin import dict_type
from StringEncoding import EncodedString from StringEncoding import EncodedString
import Naming import Naming
class DoctestHackTransform(ScopeTrackingTransform): class AutoTestDictTransform(ScopeTrackingTransform):
# Handles doctesthack directive # Handles autotestdict directive
def visit_ModuleNode(self, node): def visit_ModuleNode(self, node):
self.scope_type = 'module' self.scope_type = 'module'
self.scope_node = node self.scope_node = node
if self.current_directives['doctesthack']: if self.current_directives['autotestdict']:
assert isinstance(node.body, StatListNode) assert isinstance(node.body, StatListNode)
# First see if __test__ is already created # First see if __test__ is already created
......
...@@ -88,7 +88,7 @@ class Context(object): ...@@ -88,7 +88,7 @@ class Context(object):
from ParseTreeTransforms import CreateClosureClasses, MarkClosureVisitor, DecoratorTransform from ParseTreeTransforms import CreateClosureClasses, MarkClosureVisitor, DecoratorTransform
from ParseTreeTransforms import InterpretCompilerDirectives, TransformBuiltinMethods from ParseTreeTransforms import InterpretCompilerDirectives, TransformBuiltinMethods
from ParseTreeTransforms import AlignFunctionDefinitions, GilCheck from ParseTreeTransforms import AlignFunctionDefinitions, GilCheck
from AnalysedTreeTransforms import DoctestHackTransform from AnalysedTreeTransforms import AutoTestDictTransform
from AutoDocTransforms import EmbedSignature from AutoDocTransforms import EmbedSignature
from Optimize import FlattenInListTransform, SwitchTransform, IterationTransform from Optimize import FlattenInListTransform, SwitchTransform, IterationTransform
from Optimize import OptimizeBuiltinCalls, ConstantFolding, FinalOptimizePhase from Optimize import OptimizeBuiltinCalls, ConstantFolding, FinalOptimizePhase
...@@ -127,7 +127,7 @@ class Context(object): ...@@ -127,7 +127,7 @@ class Context(object):
WithTransform(self), WithTransform(self),
DecoratorTransform(self), DecoratorTransform(self),
AnalyseDeclarationsTransform(self), AnalyseDeclarationsTransform(self),
DoctestHackTransform(self), AutoTestDictTransform(self),
EmbedSignature(self), EmbedSignature(self),
TransformBuiltinMethods(self), TransformBuiltinMethods(self),
IntroduceBufferAuxiliaryVars(self), IntroduceBufferAuxiliaryVars(self),
......
...@@ -68,7 +68,7 @@ option_defaults = { ...@@ -68,7 +68,7 @@ option_defaults = {
'c99_complex' : False, # Don't use macro wrappers for complex arith, not sure what to name this... 'c99_complex' : False, # Don't use macro wrappers for complex arith, not sure what to name this...
'callspec' : "", 'callspec' : "",
'profile': False, 'profile': False,
'doctesthack': False 'autotestdict': True
} }
# Override types possibilities above, if needed # Override types possibilities above, if needed
...@@ -80,7 +80,7 @@ for key, val in option_defaults.items(): ...@@ -80,7 +80,7 @@ for key, val in option_defaults.items():
option_scopes = { # defaults to available everywhere option_scopes = { # defaults to available everywhere
# 'module', 'function', 'class', 'with statement' # 'module', 'function', 'class', 'with statement'
'doctesthack' : ('module',) 'autotestdict' : ('module',)
} }
def parse_option_value(name, value): def parse_option_value(name, value):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment