From a1675dfe2ed1f5a37a5a78584c975aaaa2d68f9e Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Mon, 15 May 2017 15:19:14 -0400 Subject: [PATCH] Change the last few tests to remove jedi completely and now tox -e py35 passes. --- conftest.py | 11 +++++------ test/test_tokenize.py | 6 ------ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/conftest.py b/conftest.py index 60b08ce..8500f03 100644 --- a/conftest.py +++ b/conftest.py @@ -48,7 +48,7 @@ def pytest_unconfigure(config): @pytest.fixture(scope='session') 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` 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. """ - from jedi import settings - old = settings.cache_directory - tmp = tempfile.mkdtemp(prefix='jedi-test-') - settings.cache_directory = tmp + old = cache._default_cache_path + tmp = tempfile.mkdtemp(prefix='parso-test-') + cache.default_cache_path = tmp @request.addfinalizer def restore(): - settings.cache_directory = old + cache._default_cache_path = old shutil.rmtree(tmp) diff --git a/test/test_tokenize.py b/test/test_tokenize.py index 2beb72a..970678f 100644 --- a/test/test_tokenize.py +++ b/test/test_tokenize.py @@ -144,12 +144,6 @@ class TokenTest(unittest.TestCase): 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(): """ Decided to parse `u''` literals regardless of Python version. This makes