mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
speed test to examples
This commit is contained in:
@@ -2,9 +2,8 @@
|
||||
addopts = --doctest-modules
|
||||
|
||||
# Ignore broken files in blackbox test directories
|
||||
norecursedirs = .* docs completion refactor
|
||||
scripts extensions speed static_analysis not_in_sys_path
|
||||
jedi/third_party
|
||||
norecursedirs = .* jedi/third_party scripts docs
|
||||
test/completion test/refactor test/static_analysis
|
||||
|
||||
# Activate `clean_jedi_cache` fixture for all tests. This should be
|
||||
# fine as long as we are using `clean_jedi_cache` as a session scoped
|
||||
|
||||
@@ -6,7 +6,7 @@ should.
|
||||
import time
|
||||
import functools
|
||||
|
||||
from .helpers import cwd_at
|
||||
from .helpers import cwd_at, get_example_dir
|
||||
import jedi
|
||||
|
||||
|
||||
@@ -50,9 +50,10 @@ def test_precedence_slowdown(Script):
|
||||
Precedence calculation can slow down things significantly in edge
|
||||
cases. Having strange recursion structures increases the problem.
|
||||
"""
|
||||
with open('speed/precedence.py') as f:
|
||||
path = get_example_dir('speed', 'precedence.py')
|
||||
with open(path) as f:
|
||||
line = len(f.read().splitlines())
|
||||
assert Script(path='speed/precedence.py').infer(line=line)
|
||||
assert Script(path=path).infer(line=line)
|
||||
|
||||
|
||||
@_check_speed(0.1)
|
||||
|
||||
Reference in New Issue
Block a user