mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Remove the has_typing fixture
This commit is contained in:
11
conftest.py
11
conftest.py
@@ -132,17 +132,6 @@ def goto_or_help_or_infer(request, Script):
|
||||
return lambda code, *args, **kwargs: getattr(Script(code), request.param)(*args, **kwargs)
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def has_typing(environment):
|
||||
if environment.version_info >= (3, 5, 0):
|
||||
# This if is just needed to avoid that tests ever skip way more than
|
||||
# they should for all Python versions.
|
||||
return True
|
||||
|
||||
script = jedi.Script('import typing', environment=environment)
|
||||
return bool(script.infer())
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def has_django(environment):
|
||||
script = jedi.Script('import django', environment=environment)
|
||||
|
||||
@@ -36,7 +36,7 @@ unspecified = %s
|
||||
""" % (case, sorted(d - a), sorted(a - d))
|
||||
|
||||
|
||||
def test_completion(case, monkeypatch, environment, has_typing, has_django):
|
||||
def test_completion(case, monkeypatch, environment, has_django):
|
||||
skip_reason = case.get_skip_reason(environment)
|
||||
if skip_reason is not None:
|
||||
pytest.skip(skip_reason)
|
||||
@@ -44,9 +44,6 @@ def test_completion(case, monkeypatch, environment, has_typing, has_django):
|
||||
if 'pep0484_typing' in case.path and sys.version_info[0] == 2:
|
||||
pytest.skip('ditch python 2 finally')
|
||||
|
||||
_CONTAINS_TYPING = ('pep0484_typing', 'pep0484_comments', 'pep0526_variables')
|
||||
if not has_typing and any(x in case.path for x in _CONTAINS_TYPING):
|
||||
pytest.skip('Needs the typing module installed to run this test.')
|
||||
if (not has_django or environment.version_info.major == 2) and case.path.endswith('django.py'):
|
||||
pytest.skip('Needs django to be installed to run this test.')
|
||||
repo_root = helpers.root_dir
|
||||
|
||||
Reference in New Issue
Block a user