]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
surprise, session.run() failing ends the nox run main
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 6 Oct 2025 21:13:22 +0000 (17:13 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 6 Oct 2025 21:13:22 +0000 (17:13 -0400)
Change-Id: I2c0b1570fb7e900ee943151b03e663c7d494edbd

noxfile.py

index dffbf9d79e62c56905d944965f251250bde4145b..d08a7c0648776cb518d63723b4d5f4ae62581c67 100644 (file)
@@ -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")