diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9a5db747f..ef87c1ff8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,7 +40,7 @@ jobs: python -m pip install dist/*.whl - name: Run tests - run: "python -m pytest -s -v --cov=httpstan tests" + run: python -m pytest -s -v --cov=httpstan tests - name: Test PyStan compatibility run: | diff --git a/httpstan/models.py b/httpstan/models.py index 1f937e9b0..f0206b040 100644 --- a/httpstan/models.py +++ b/httpstan/models.py @@ -151,7 +151,7 @@ async def build_services_extension_module(program_code: str, extra_compile_args: # where to find shared libraries during execution. There are two ways for an # extension module to find shared libraries: LD_LIBRARY_PATH and rpath. libraries = ["sundials_cvodes", "sundials_idas", "sundials_nvecserial", "tbb"] - if platform.system() == "Darwin": + if platform.system() == "Darwin": # pragma: no cover libraries.extend(["tbbmalloc", "tbbmalloc_proxy"]) extension = setuptools.Extension( f"stan_services_{stan_model_name}", # filename only. Module name is "stan_services" diff --git a/httpstan/schemas.py b/httpstan/schemas.py index e9f774ad2..80359268c 100644 --- a/httpstan/schemas.py +++ b/httpstan/schemas.py @@ -23,9 +23,9 @@ class Operation(marshmallow.Schema): @marshmallow.validates_schema def validate_result(self, data: dict, many: bool, partial: bool) -> None: assert not many and not partial, "Use of `many` and `partial` with schema unsupported." - if data["done"] and data.get("result") is None: + if data["done"] and data.get("result") is None: # pragma: no cover raise marshmallow.ValidationError("If `done` then `result` must be set.", "result") - if not data["done"] and data.get("result"): + if not data["done"] and data.get("result"): # pragma: no cover raise marshmallow.ValidationError("If not `done` then `result` must be empty.", "result") diff --git a/httpstan/views.py b/httpstan/views.py index e69e3e20c..d2fae0359 100644 --- a/httpstan/views.py +++ b/httpstan/views.py @@ -112,7 +112,7 @@ async def handle_create_model(request: aiohttp.web.Request) -> aiohttp.web.Respo try: # `build_services_extension_module` has side-effect of storing extension module in cache compiler_output = await httpstan.models.build_services_extension_module(program_code) - except Exception as exc: + except Exception as exc: # pragma: no cover message, status = ( f"Exception while building model extension module: `{repr(exc)}`, traceback: `{traceback.format_tb(exc.__traceback__)}`", 400, diff --git a/pyproject.toml b/pyproject.toml index aff795629..a4f6260ec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,7 +67,7 @@ known_local_folder = "helpers" [tool.coverage.run] branch = true -omit = httpstan/__main__.py +omit = ["httpstan/__main__.py"] [tool.coverage.report] fail_under = 95