File: test_modulefinder.py

package info (click to toggle)
pypy 5.6.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 97,040 kB
  • ctags: 185,069
  • sloc: python: 1,147,862; ansic: 49,642; cpp: 5,245; asm: 5,169; makefile: 529; sh: 481; xml: 232; lisp: 45
file content (22 lines) | stat: -rw-r--r-- 770 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import py
from rpython.tool.jitlogparser.module_finder import gather_all_code_objs
import re, sys

def setup_module(mod):
    if sys.version_info[:2] != (2, 6):
        py.test.skip("Specific python 2.6 tests")

def test_gather_code_py():
    py.test.skip("XXX broken, fix me")
    fname = re.__file__
    codes = gather_all_code_objs(fname)
    assert len(codes) == 21
    assert sorted(codes.keys()) == [102, 134, 139, 144, 153, 164, 169, 181, 188, 192, 197, 206, 229, 251, 266, 271, 277, 285, 293, 294, 308]

def test_load_code():
    py.test.skip("XXX broken, fix me")
    fname = re.__file__
    code = gather_all_code_objs(fname)[144]
    assert code.co_name == 'sub'
    assert code.co_filename == '/usr/lib/python2.6/re.py'
    assert code.co_firstlineno == 144