From 6b755191458d54c52b2a9124604fb5d4cfd670e6 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sat, 31 Mar 2018 18:38:09 +0200 Subject: [PATCH] Better tests for fstrings --- test/completion/fstring.py | 3 +++ test/test_evaluate/test_fstring.py | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 test/test_evaluate/test_fstring.py diff --git a/test/completion/fstring.py b/test/completion/fstring.py index e6f9b83c..52e81123 100644 --- a/test/completion/fstring.py +++ b/test/completion/fstring.py @@ -22,3 +22,6 @@ F"{Excepti Fr'a{Foo.bar' #? str() Fr'sasdf' + +#? 7 str() +Fr'''sasdf''' + '' diff --git a/test/test_evaluate/test_fstring.py b/test/test_evaluate/test_fstring.py new file mode 100644 index 00000000..2805e44b --- /dev/null +++ b/test/test_evaluate/test_fstring.py @@ -0,0 +1,19 @@ +import pytest +from textwrap import dedent + + +@pytest.fixture(autouse=True) +def skip_not_supported(environment): + if environment.version_info < (3, 6): + pytest.skip() + + +def test_fstring_multiline(Script): + code = dedent("""\ + '' f'''s{ + str.uppe + ''' + """ + ) + c, = Script(code, line=2, column=9).completions() + assert c.name == 'upper'