From e02983ce78fc8c0baec593b0db5193146c1b1d0b Mon Sep 17 00:00:00 2001 From: Sean Vig Date: Fri, 14 May 2021 22:08:10 -0400 Subject: [PATCH] Exclude some lines from coverage --- .coveragerc | 2 ++ pywayland/__init__.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.coveragerc b/.coveragerc index 08e227b..8723261 100644 --- a/.coveragerc +++ b/.coveragerc @@ -12,3 +12,5 @@ source = [report] exclude_lines = if TYPE_CHECKING: + if __name__ == "__main__": + except ImportError: diff --git a/pywayland/__init__.py b/pywayland/__init__.py index f878b03..f88957d 100644 --- a/pywayland/__init__.py +++ b/pywayland/__init__.py @@ -16,7 +16,7 @@ try: from ._ffi import ffi, lib # noqa: F401 -except ImportError: # pragma: no cover +except ImportError: raise ImportError( "No module named pywayland._ffi, be sure to run `python ./pywayland/ffi_build.py`" )