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