diff --git a/docs/changelog.txt b/docs/changelog.txt index b31ba793..a5aa3003 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -4,6 +4,12 @@ Changelog .. currentmodule:: firebird.qa.plugin +Version 0.17.1 +============== + +* When database initialization script fails, the XML output is extended with `dbinit-stderr` + property that contains `stderr` output with errors reported by ISQL. + Version 0.17.0 ============== diff --git a/docs/conf.py b/docs/conf.py index 1080aba0..02b173e2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -23,10 +23,10 @@ copyright = '2022, Pavel Cisar' author = 'Pavel Císař' # The short X.Y version -version = '0.17.0' +version = '0.17.1' # The full version, including alpha/beta/rc tags -release = '0.17.0' +release = '0.17.1' # -- General configuration --------------------------------------------------- diff --git a/firebird/qa/plugin.py b/firebird/qa/plugin.py index abe2c29f..d2b43c21 100644 --- a/firebird/qa/plugin.py +++ b/firebird/qa/plugin.py @@ -58,7 +58,7 @@ from threading import Thread, Barrier from firebird.driver import connect, connect_server, create_database, driver_config, \ NetProtocol, Server, CHARSET_MAP, Connection, Cursor, \ DESCRIPTION_NAME, DESCRIPTION_DISPLAY_SIZE, DatabaseConfig, DBKeyScope, DbInfoCode, \ - DbWriteMode, get_api + DbWriteMode, get_api, Error from firebird.driver.core import _connect_helper Substitutions = List[Tuple[str, str]] @@ -674,7 +674,7 @@ class Database: print(result.stdout) print(f"-- stderr {'-' * 20}") print(result.stderr) - raise Exception("Database init script execution failed") + raise Error("Database init script execution failed", stderr=result.stderr) return result def drop(self) -> None: """Drop the test database. @@ -804,7 +804,12 @@ def db_factory(*, filename: str='test.fdb', init: Optional[str]=None, if async_write: db.set_async_write() if init: # Do not check for None, we want to skip empty scripts as well - db.init(init) + try: + db.init(init) + except Error as exc: + if hasattr(exc, 'stderr'): + request.node.user_properties.append(("dbinit-stderr", exc.stderr)) + raise yield db if not do_not_drop: db.drop() diff --git a/setup.cfg b/setup.cfg index 863f00e7..81c20546 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,7 +5,7 @@ all-files=True [metadata] name = firebird-qa -version = 0.17.0 +version = 0.17.1 description = pytest plugin for Firebird QA long_description = file: README.rst long_description_content_type = text/x-rst; charset=UTF-8