6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 13:33:07 +01:00
This commit is contained in:
zotov 2022-11-29 08:19:26 +03:00
commit 92659d1645
4 changed files with 17 additions and 6 deletions

View File

@ -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
==============

View File

@ -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 ---------------------------------------------------

View File

@ -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()

View File

@ -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