Author: Alex Gaynor <[email protected]>
Branch: kill-someobject
Changeset: r57875:c947278ffa5d
Date: 2012-10-08 09:37 +0200
http://bitbucket.org/pypy/pypy/changeset/c947278ffa5d/
Log: a bit of test cleanup
diff --git a/pypy/rlib/parsing/test/test_deterministic.py
b/pypy/rlib/parsing/test/test_deterministic.py
--- a/pypy/rlib/parsing/test/test_deterministic.py
+++ b/pypy/rlib/parsing/test/test_deterministic.py
@@ -1,6 +1,6 @@
from pypy.rlib.parsing.deterministic import *
+from pypy.translator.interactive import Translation
-from sets import Set
def test_DFA_simple():
a = DFA()
@@ -24,11 +24,8 @@
assert py.test.raises(LexerError, "recognize('xzya')")
assert recognize("aaaacb")
+
def test_compile_recognizer():
- try:
- from pypy.translator.interactive import Translation
- except ImportError:
- py.test.skip("pypy not found on path")
a = DFA()
s0 = a.add_state("start")
s1 = a.add_state()
@@ -45,6 +42,7 @@
assert cfn("b")
assert cfn("aaaacb")
+
def test_NFA_simple():
a = NFA()
z0 = a.add_state("z0", start=True)
diff --git a/pypy/rlib/test/test_jit.py b/pypy/rlib/test/test_jit.py
--- a/pypy/rlib/test/test_jit.py
+++ b/pypy/rlib/test/test_jit.py
@@ -1,18 +1,21 @@
import py
+
from pypy.conftest import option
-from pypy.rlib.jit import hint, we_are_jitted, JitDriver, elidable_promote
-from pypy.rlib.jit import JitHintError, oopspec, isconstant
+from pypy.annotation.model import UnionError
+from pypy.rlib.jit import (hint, we_are_jitted, JitDriver, elidable_promote,
+ JitHintError, oopspec, isconstant)
from pypy.rlib.rarithmetic import r_uint
-from pypy.translator.translator import TranslationContext, graphof
from pypy.rpython.test.tool import BaseRtypingTest, LLRtypeMixin, OORtypeMixin
from pypy.rpython.lltypesystem import lltype
+
def test_oopspec():
@oopspec('foobar')
def fn():
pass
assert fn.oopspec == 'foobar'
-
+
+
class BaseTestJIT(BaseRtypingTest):
def test_hint(self):
def f():
@@ -91,7 +94,7 @@
for graph in t.graphs:
if getattr(graph, 'func', None) is func:
return [v.concretetype for v in graph.getargs()]
- raise Exception, 'function %r has not been annotated' % func
+ raise Exception('function %r has not been annotated' % func)
get_printable_location_args = getargs(get_printable_location)
assert get_printable_location_args == [lltype.Float]
@@ -108,15 +111,17 @@
def test_annotate_typeerror(self):
myjitdriver = JitDriver(greens=['m'], reds=['n'])
- class A(object): pass
- class B(object): pass
+ class A(object):
+ pass
+ class B(object):
+ pass
def fn(n):
while n > 0:
myjitdriver.can_enter_jit(m=A(), n=n)
myjitdriver.jit_merge_point(m=B(), n=n)
n -= 1
return n
- py.test.raises(JitHintError, self.gengraph, fn, [int])
+ py.test.raises(UnionError, self.gengraph, fn, [int])
def test_green_field(self):
def get_printable_location(xfoo):
diff --git a/pypy/rpython/lltypesystem/opimpl.py
b/pypy/rpython/lltypesystem/opimpl.py
--- a/pypy/rpython/lltypesystem/opimpl.py
+++ b/pypy/rpython/lltypesystem/opimpl.py
@@ -1,9 +1,8 @@
-from pypy.tool.sourcetools import func_with_new_name
-from pypy.rpython.lltypesystem import lltype, llmemory
-from pypy.rpython.lltypesystem.lloperation import FunctionByName
+from pypy.objspace.flow.operation import FunctionByName
from pypy.rlib import debug
from pypy.rlib.rarithmetic import is_valid_int
-
+from pypy.rpython.lltypesystem import lltype, llmemory
+from pypy.tool.sourcetools import func_with_new_name
# ____________________________________________________________
# Implementation of the 'canfold' operations
@@ -27,8 +26,8 @@
else:
r_longlong_arg = r_longlong
r_longlong_result = r_longlong
-
-
+
+
r_longlonglong_arg = r_longlonglong
r_longlonglong_result = r_longlonglong
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit