Debian Codegraph @

dotviewer/test/test_translator.py

raw symbols SCIP
1 """
2 Test the integration with PyPy.
3 """
4
5 import py, sys
6 from dotviewer.conftest import option
7
8 def setup_module(mod):
9 if not option.pygame:
10 py.test.skip("--pygame not enabled")
11 try:
12 import pypy
13 except ImportError:
14 py.test.skip("cannot import pypy")
15
16 # ____________________________________________________________
17
18 def is_prime(n):
19 divisors = [d for d in range(1, n+1) if n % d == 0]
20 return len(divisors) == 2
21
22
23 def test_annotated():
24 from rpython.translator.interactive import Translation
25 t = Translation(is_prime, [int])
26 t.annotate()
27 t.viewcg()