summaryrefslogtreecommitdiffstats
path: root/tests/test_smart_completion_public_schema_only.py
diff options
context:
space:
mode:
authorMiroslav Šedivý <6774676+eumiro@users.noreply.github.com>2021-02-12 20:34:56 +0100
committerGitHub <noreply@github.com>2021-02-12 21:34:56 +0200
commit762fb4b8da98fdf6792e6c5586060ed37224f894 (patch)
treedca17819ff2a516988e2f74691dcef0554637464 /tests/test_smart_completion_public_schema_only.py
parent87ffae295edf4fb2a9c33c552b12f09921def29f (diff)
Modernize code to Python 3.6+ (#1229)
1. `class A(object)` can be written as `class A:` 2. replace `dict([…])` and `set([…])` with `{…}` 3. use f-strings or compact `.format` 4. use `yield from` instead of `yield` in a `for` loop 5. import `mock` from `unittest` 6. expect `OSError` instead of `IOError` or `select` error 7. use Python3 defaults for file reading or `super()` 8. remove redundant parenthesis (keep those in tuples though) 9. shorten set intersection instead of creating lists 10. backslashes in strings do not have to be escaped if prepended with `r`
Diffstat (limited to 'tests/test_smart_completion_public_schema_only.py')
-rw-r--r--tests/test_smart_completion_public_schema_only.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_smart_completion_public_schema_only.py b/tests/test_smart_completion_public_schema_only.py
index b9357092..db1fe0a3 100644
--- a/tests/test_smart_completion_public_schema_only.py
+++ b/tests/test_smart_completion_public_schema_only.py
@@ -53,7 +53,7 @@ metadata = {
],
}
-metadata = dict((k, {"public": v}) for k, v in metadata.items())
+metadata = {k: {"public": v} for k, v in metadata.items()}
testdata = MetaData(metadata)
@@ -296,7 +296,7 @@ def test_suggested_cased_always_qualified_column_names(completer):
def test_suggested_column_names_in_function(completer):
result = get_result(completer, "SELECT MAX( from users", len("SELECT MAX("))
assert completions_to_set(result) == completions_to_set(
- (testdata.columns_functions_and_keywords("users"))
+ testdata.columns_functions_and_keywords("users")
)
@@ -316,7 +316,7 @@ def test_suggested_column_names_with_alias(completer):
def test_suggested_multiple_column_names(completer):
result = get_result(completer, "SELECT id, from users u", len("SELECT id, "))
assert completions_to_set(result) == completions_to_set(
- (testdata.columns_functions_and_keywords("users"))
+ testdata.columns_functions_and_keywords("users")
)