mirror of
https://github.com/davidhalter/parso.git
synced 2025-12-08 05:34:51 +08:00
Remove support for parsing Python 2
This commit is contained in:
42
conftest.py
42
conftest.py
@@ -2,7 +2,6 @@ import re
|
||||
import tempfile
|
||||
import shutil
|
||||
import logging
|
||||
import sys
|
||||
import os
|
||||
|
||||
import pytest
|
||||
@@ -13,8 +12,7 @@ from parso.utils import parse_version_string
|
||||
|
||||
collect_ignore = ["setup.py"]
|
||||
|
||||
VERSIONS_2 = '2.7',
|
||||
VERSIONS_3 = '3.4', '3.5', '3.6', '3.7', '3.8'
|
||||
_SUPPORTED_VERSIONS = '3.6', '3.7', '3.8', '3.9', '3.10'
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
@@ -52,15 +50,10 @@ def pytest_generate_tests(metafunc):
|
||||
ids=[c.name for c in cases]
|
||||
)
|
||||
elif 'each_version' in metafunc.fixturenames:
|
||||
metafunc.parametrize('each_version', VERSIONS_2 + VERSIONS_3)
|
||||
elif 'each_py2_version' in metafunc.fixturenames:
|
||||
metafunc.parametrize('each_py2_version', VERSIONS_2)
|
||||
elif 'each_py3_version' in metafunc.fixturenames:
|
||||
metafunc.parametrize('each_py3_version', VERSIONS_3)
|
||||
elif 'version_ge_py36' in metafunc.fixturenames:
|
||||
metafunc.parametrize('version_ge_py36', ['3.6', '3.7', '3.8'])
|
||||
metafunc.parametrize('each_version', _SUPPORTED_VERSIONS)
|
||||
elif 'version_ge_py38' in metafunc.fixturenames:
|
||||
metafunc.parametrize('version_ge_py38', ['3.8'])
|
||||
ge38 = set(_SUPPORTED_VERSIONS) - {'3.6', '3.7'}
|
||||
metafunc.parametrize('version_ge_py38', sorted(ge38))
|
||||
|
||||
|
||||
class NormalizerIssueCase(object):
|
||||
@@ -137,37 +130,16 @@ def works_not_in_py(each_version):
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def works_in_py2(each_version):
|
||||
return Checker(each_version, each_version.startswith('2'))
|
||||
def works_in_py(each_version):
|
||||
return Checker(each_version, True)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def works_ge_py27(each_version):
|
||||
version_info = parse_version_string(each_version)
|
||||
return Checker(each_version, version_info >= (2, 7))
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def works_ge_py3(each_version):
|
||||
version_info = parse_version_string(each_version)
|
||||
return Checker(each_version, version_info >= (3, 0))
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def works_ge_py35(each_version):
|
||||
version_info = parse_version_string(each_version)
|
||||
return Checker(each_version, version_info >= (3, 5))
|
||||
|
||||
@pytest.fixture
|
||||
def works_ge_py36(each_version):
|
||||
version_info = parse_version_string(each_version)
|
||||
return Checker(each_version, version_info >= (3, 6))
|
||||
|
||||
@pytest.fixture
|
||||
def works_ge_py38(each_version):
|
||||
version_info = parse_version_string(each_version)
|
||||
return Checker(each_version, version_info >= (3, 8))
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def works_ge_py39(each_version):
|
||||
version_info = parse_version_string(each_version)
|
||||
|
||||
Reference in New Issue
Block a user