From 067de6f948fba66a61a56ff1d151c98e281dc006 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Thu, 31 Aug 2023 13:10:40 +0000 Subject: [PATCH] coverage: Skip zerver.lib.migrate coverage. It is only covered when we run migration tests, which we are not guaranteed to always be able to do. --- tools/test-backend | 3 +++ zerver/lib/migrate.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/test-backend b/tools/test-backend index c709e23e79..415a439135 100755 --- a/tools/test-backend +++ b/tools/test-backend @@ -122,6 +122,9 @@ not_yet_fully_covered = [ # Cannot have coverage, as tests run in a transaction "zerver/lib/safe_session_cached_db.py", "zerver/lib/singleton_bmemcached.py", + # Only covered when we run migrations tests, which are not + # guaranteed to exist or be runnable + "zerver/lib/migrate.py", # Branches in Django settings files are hard to test "zproject/computed_settings.py", "zproject/dev_settings.py", diff --git a/zerver/lib/migrate.py b/zerver/lib/migrate.py index ab1b7b3d24..5c341e6e01 100644 --- a/zerver/lib/migrate.py +++ b/zerver/lib/migrate.py @@ -11,7 +11,7 @@ def do_batch_update( assignments: List[Composable], batch_size: int = 10000, sleep: float = 0.1, -) -> None: # nocoverage +) -> None: # The string substitution below is complicated by our need to # support multiple PostgreSQL versions. stmt = SQL(