]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Fix --dbs test option
authorFederico Caselli <cfederico87@gmail.com>
Sun, 22 Oct 2023 09:25:28 +0000 (11:25 +0200)
committerFederico Caselli <cfederico87@gmail.com>
Sun, 22 Oct 2023 09:25:33 +0000 (11:25 +0200)
At some point a version of pytest seems to have broken the
previous implementation

Change-Id: I7dfd4c8743f5214a3110dd1b6da4fa8296895899

lib/sqlalchemy/testing/plugin/plugin_base.py

index 585f6bac3cd69ab1214a75cf1b81f43dd343b98e..f6a7f152b79e333173c1ff0ee0347432afe016af 100644 (file)
@@ -14,6 +14,7 @@ from argparse import Namespace
 import configparser
 import logging
 import os
+from pathlib import Path
 import re
 import sys
 from typing import Any
@@ -320,6 +321,10 @@ def _log(opt_str, value, parser):
 
 
 def _list_dbs(*args):
+    if file_config is None:
+        # assume the current working directory is the one containing the
+        # setup file
+        read_config(Path.cwd())
     print("Available --db options (use --dburi to override)")
     for macro in sorted(file_config.options("db")):
         print("%20s\t%s" % (macro, file_config.get("db", macro)))