From: Mike Bayer Date: Mon, 6 Oct 2025 21:13:22 +0000 (-0400) Subject: surprise, session.run() failing ends the nox run X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;ds=sidebyside;p=thirdparty%2Fsqlalchemy%2Falembic.git surprise, session.run() failing ends the nox run Change-Id: I2c0b1570fb7e900ee943151b03e663c7d494edbd --- diff --git a/noxfile.py b/noxfile.py index dffbf9d7..d08a7c06 100644 --- a/noxfile.py +++ b/noxfile.py @@ -174,28 +174,28 @@ def _tests( cmd.extend(posargs) - session.run(*cmd) - - # name the suites distinctly as well. this is so that when they - # get merged we can view each suite distinctly rather than them getting - # overwritten with each other since they are running the same tests - if opts.generate_junit: - - # produce individual junit files that are per-database (or as close as - # we can get). jenkins junit plugin will merge all the files... - if len(databases) == 1: - junitfile = f"junit-{databases[0]}.xml" - suite_name = f"pytest-{databases[0]}" - else: - junitfile = "junit-general.xml" - suite_name = "pytest-general" - - move_junit_file("junit-tmp.xml", junitfile, suite_name) - - # Run cleanup for oracle/mssql - for database in databases: - if database in ["oracle", "mssql"]: - session.run("python", "reap_dbs.py", "db_idents.txt") + try: + session.run(*cmd) + finally: + # name the suites distinctly as well. this is so that when they get + # merged we can view each suite distinctly rather than them getting + # overwritten with each other since they are running the same tests + if opts.generate_junit: + # produce individual junit files that are per-database (or as close + # as we can get). jenkins junit plugin will merge all the files... + if len(databases) == 1: + junitfile = f"junit-{databases[0]}.xml" + suite_name = f"pytest-{databases[0]}" + else: + junitfile = "junit-general.xml" + suite_name = "pytest-general" + + move_junit_file("junit-tmp.xml", junitfile, suite_name) + + # Run cleanup for oracle/mssql + for database in databases: + if database in ["oracle", "mssql"]: + session.run("python", "reap_dbs.py", "db_idents.txt") @nox.session(name="pep484")