code coverage
change
commit 27cab4db7e458f7ff52e637366887d0b49f4ecf8
author Alpha Chen <alpha@kejadlen.dev>
date
parent 37c39f7f
diff --git a/go_ji/__init__.py b/go_ji/__init__.py
index e42b9d5..e6e92b8 100644
--- a/go_ji/__init__.py
+++ b/go_ji/__init__.py
@@ -23,7 +23,7 @@ def create_app(config_override: dict[str, Any] = {}) -> Flask:
     app.config.from_mapping(CONFIG)
     app.config.from_mapping(config_override)
 
-    if "TESTING" not in app.config:
+    if "TESTING" not in app.config:  # pragma: no cover
         sentry_sdk.init(
             dsn=app.config["SENTRY_DSN"],
             environment=app.config["SENTRY_ENVIRONMENT"],
@@ -110,6 +110,6 @@ def create_app(config_override: dict[str, Any] = {}) -> Flask:
     @app.route("/die")
     def die():
         1 / 0  # raises an error
-        return "<p>Hello, World!</p>"
+        return "<p>Hello, World!</p>"  # pragma: no cover
 
     return app
diff --git a/tests/test_go_ji.py b/tests/test_go_ji.py
index a14377c..ac1790e 100644
--- a/tests/test_go_ji.py
+++ b/tests/test_go_ji.py
@@ -129,3 +129,8 @@ class TestGo:
             response = client.get("/foo")
 
             assert response.status_code == 404
+
+def test_die(authed, client):
+    with authed:
+        with pytest.raises(ZeroDivisionError):
+            client.get("/die")