From 4f6116ac6ebb2128a18d90a5c8aee7e42a2d3d24 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sun, 12 Jan 2020 01:21:26 +0100 Subject: [PATCH] speed test to examples --- pytest.ini | 5 ++--- test/{ => examples}/speed/precedence.py | 0 test/test_speed.py | 7 ++++--- 3 files changed, 6 insertions(+), 6 deletions(-) rename test/{ => examples}/speed/precedence.py (100%) diff --git a/pytest.ini b/pytest.ini index 16b886fa..b2ee0d8e 100644 --- a/pytest.ini +++ b/pytest.ini @@ -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 diff --git a/test/speed/precedence.py b/test/examples/speed/precedence.py similarity index 100% rename from test/speed/precedence.py rename to test/examples/speed/precedence.py diff --git a/test/test_speed.py b/test/test_speed.py index 91f172b5..bd865f23 100644 --- a/test/test_speed.py +++ b/test/test_speed.py @@ -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)