mirror of
https://github.com/davidhalter/parso.git
synced 2025-12-07 21:34:32 +08:00
Change the last few tests to remove jedi completely and now tox -e py35 passes.
This commit is contained in:
11
conftest.py
11
conftest.py
@@ -48,7 +48,7 @@ def pytest_unconfigure(config):
|
|||||||
@pytest.fixture(scope='session')
|
@pytest.fixture(scope='session')
|
||||||
def clean_parso_cache(request):
|
def clean_parso_cache(request):
|
||||||
"""
|
"""
|
||||||
Set `jedi.settings.cache_directory` to a temporary directory during test.
|
Set the default cache directory to a temporary directory during tests.
|
||||||
|
|
||||||
Note that you can't use built-in `tmpdir` and `monkeypatch`
|
Note that you can't use built-in `tmpdir` and `monkeypatch`
|
||||||
fixture here because their scope is 'function', which is not used
|
fixture here because their scope is 'function', which is not used
|
||||||
@@ -56,12 +56,11 @@ def clean_parso_cache(request):
|
|||||||
|
|
||||||
This fixture is activated in ../pytest.ini.
|
This fixture is activated in ../pytest.ini.
|
||||||
"""
|
"""
|
||||||
from jedi import settings
|
old = cache._default_cache_path
|
||||||
old = settings.cache_directory
|
tmp = tempfile.mkdtemp(prefix='parso-test-')
|
||||||
tmp = tempfile.mkdtemp(prefix='jedi-test-')
|
cache.default_cache_path = tmp
|
||||||
settings.cache_directory = tmp
|
|
||||||
|
|
||||||
@request.addfinalizer
|
@request.addfinalizer
|
||||||
def restore():
|
def restore():
|
||||||
settings.cache_directory = old
|
cache._default_cache_path = old
|
||||||
shutil.rmtree(tmp)
|
shutil.rmtree(tmp)
|
||||||
|
|||||||
@@ -144,12 +144,6 @@ class TokenTest(unittest.TestCase):
|
|||||||
assert string_tok.value == s
|
assert string_tok.value == s
|
||||||
|
|
||||||
|
|
||||||
def test_tokenizer_with_string_literal_backslash():
|
|
||||||
import jedi
|
|
||||||
c = jedi.Script("statement = u'foo\\\n'; statement").goto_definitions()
|
|
||||||
assert c[0]._name._context.obj == 'foo'
|
|
||||||
|
|
||||||
|
|
||||||
def test_ur_literals():
|
def test_ur_literals():
|
||||||
"""
|
"""
|
||||||
Decided to parse `u''` literals regardless of Python version. This makes
|
Decided to parse `u''` literals regardless of Python version. This makes
|
||||||
|
|||||||
Reference in New Issue
Block a user