Skip to content

Commit a26f75c

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

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Lib/sqlite3/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def runsource(self, source, filename="<input>", symbol="single"):
6363
if source[0] == ".":
6464
match source[1:].strip():
6565
case "tables":
66-
schema_names = tuple(row[1]
66+
schema_names = (row[1]
6767
for row in self._cur.execute("PRAGMA database_list"))
6868
select_clauses = (f"""SELECT
6969
CASE '{schema}'
@@ -83,7 +83,7 @@ def runsource(self, source, filename="<input>", symbol="single"):
8383
case "help":
8484
t = theme.syntax
8585
print(f"Enter SQL code or one of the below commands, and press enter.\n\n"
86-
f"{t.builtin}.tables{t.reset} List names of tables\n"
86+
f"{t.builtin}.tables{t.reset} Print names of tables\n"
8787
f"{t.builtin}.version{t.reset} Print underlying SQLite library version\n"
8888
f"{t.builtin}.help{t.reset} Print this help message\n"
8989
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)