Skip to content

Commit

Permalink
Remove unnecessary coverage pragmas
Browse files Browse the repository at this point in the history
  • Loading branch information
jace committed Dec 11, 2023
1 parent 3c8d823 commit 437b605
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/coaster/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
mod_tomli: t.Optional[types.ModuleType] = None
mod_yaml: t.Optional[types.ModuleType] = None

try: # pragma: no cover
try:
import toml as mod_toml # type: ignore[no-redef,unused-ignore]
except ModuleNotFoundError:
try:
Expand All @@ -52,7 +52,7 @@
pass


try: # pragma: no cover
try:
import yaml as mod_yaml
except ModuleNotFoundError:
pass
Expand Down
4 changes: 2 additions & 2 deletions src/coaster/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@

from .sqlalchemy import Query

try: # pragma: no cover
try:
from psycopg2.extensions import connection as Psycopg2Connection # noqa: N812
except ModuleNotFoundError:
Psycopg2Connection = None

try: # pragma: no cover
try:
from psycopg import Connection as Psycopg3Connection
except ModuleNotFoundError:
Psycopg3Connection = None # type: ignore[assignment,misc]
Expand Down
2 changes: 1 addition & 1 deletion src/coaster/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from flask import g, request, session
from flask.config import Config

try: # Flask >= 3.0 # pragma: no cover
try: # Flask >= 3.0
from flask.sansio.app import App as FlaskApp
except ModuleNotFoundError:
from flask import Flask as FlaskApp
Expand Down
2 changes: 1 addition & 1 deletion src/coaster/sqlalchemy/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class MyModel(BaseMixin[int], Model): # Integer serial primary key; alt: UUID

from flask import current_app, url_for

try: # Flask >= 3.0 # pragma: no cover
try: # Flask >= 3.0
from flask.sansio.app import App as FlaskApp
except ModuleNotFoundError: # Flask < 3.0
from flask import Flask as FlaskApp
Expand Down
2 changes: 1 addition & 1 deletion src/coaster/views/classview.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from flask.globals import _cv_app, app_ctx
from flask.typing import ResponseReturnValue

try: # Flask >= 3.0 # pragma: no cover
try: # Flask >= 3.0
from flask.sansio.app import App as FlaskApp
from flask.sansio.blueprints import Blueprint, BlueprintSetupState
except ModuleNotFoundError: # Flask < 3.0
Expand Down
2 changes: 1 addition & 1 deletion src/coaster/views/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from werkzeug.exceptions import MethodNotAllowed, NotFound
from werkzeug.routing import MapAdapter, RequestRedirect, Rule

try: # pragma: no cover
try:
from asgiref.sync import async_to_sync
except ModuleNotFoundError:
async_to_sync = None # type: ignore[assignment, misc]
Expand Down

0 comments on commit 437b605

Please sign in to comment.