Skip to content

Commit 459bc02

Browse files
committed
remove unnecessary collection of schema name with tuple(); update help text for consistency; simplify view creation in test case
1 parent f0ace80 commit 459bc02

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

Lib/sqlite3/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def runsource(self, source, filename="<input>", symbol="single"):
6464
if source[0] == ".":
6565
match source[1:].strip():
6666
case "tables":
67-
schema_names = tuple(row[1]
67+
schema_names = (row[1]
6868
for row in self._cur.execute("PRAGMA database_list"))
6969
select_clauses = (f"""SELECT
7070
CASE '{schema}'
@@ -84,7 +84,7 @@ def runsource(self, source, filename="<input>", symbol="single"):
8484
case "help":
8585
t = theme.syntax
8686
print(f"Enter SQL code or one of the below commands, and press enter.\n\n"
87-
f"{t.builtin}.tables{t.reset} List names of tables\n"
87+
f"{t.builtin}.tables{t.reset} Print names of tables\n"
8888
f"{t.builtin}.version{t.reset} Print underlying SQLite library version\n"
8989
f"{t.builtin}.help{t.reset} Print this help message\n"
9090
f"{t.builtin}.quit{t.reset} Exit the CLI, equivalent to CTRL-D\n")

Lib/test/test_sqlite3/test_cli.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,14 @@ def test_interact_tables(self):
129129
out, err = self.run_cli(commands=(
130130
"CREATE TABLE table_ (id INTEGER);",
131131
"CREATE TEMP TABLE temp_table (id INTEGER);",
132-
"CREATE VIEW view_ AS SELECT * FROM table_;",
133-
"CREATE TEMP VIEW temp_view As SELECT * FROM table_;",
132+
"CREATE VIEW view_ AS SELECT 1;",
133+
"CREATE TEMP VIEW temp_view AS SELECT 1;",
134134
"ATTACH ':memory:' AS attach_;",
135135
"CREATE TABLE attach_.table_ (id INTEGER);",
136-
"CREATE VIEW attach_.view_ AS SELECT * FROM table_;",
136+
"CREATE VIEW attach_.view_ AS SELECT 1;",
137137
"ATTACH ':memory:' AS 123;",
138138
"CREATE TABLE \"123\".table_ (id INTEGER);",
139-
"CREATE VIEW \"123\".view_ AS SELECT * FROM table_;",
139+
"CREATE VIEW \"123\".view_ AS SELECT 1;",
140140
".tables",
141141
))
142142
self.assertIn(self.MEMORY_DB_MSG, err)

0 commit comments

Comments
 (0)