From 9bce86aea5f9c3d8676d378bf731b0921173ec5d Mon Sep 17 00:00:00 2001 From: Dmitry Dygalo Date: Fri, 5 Mar 2021 17:22:18 +0100 Subject: [PATCH] Disable coverage on PyPy --- .github/workflows/ci.yml | 3 ++- src/hypothesis_jsonschema/_encode.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c2e9752..78d6dcf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,8 @@ jobs: - name: Install dependencies run: python -m pip install --upgrade pip setuptools tox - name: Run tests - run: python -m tox --recreate -e test + # Disable coverage on PyPy + run: python -m tox --recreate -e test $(${{ startsWith(matrix.python-version, 'pypy') }} && echo '-- -n auto --no-cov') release: runs-on: ubuntu-latest diff --git a/src/hypothesis_jsonschema/_encode.py b/src/hypothesis_jsonschema/_encode.py index 8f1a423..74df1a0 100644 --- a/src/hypothesis_jsonschema/_encode.py +++ b/src/hypothesis_jsonschema/_encode.py @@ -11,7 +11,7 @@ if PYTHON_IMPLEMENTATION != "PyPy": from json.encoder import _make_iterencode, encode_basestring_ascii # type: ignore -else: +else: # pragma: no cover _make_iterencode = None encode_basestring_ascii = None @@ -27,7 +27,7 @@ def _floatstr(o: float) -> str: class CanonicalisingJsonEncoder(json.JSONEncoder): - if PYTHON_IMPLEMENTATION == "PyPy": + if PYTHON_IMPLEMENTATION == "PyPy": # pragma: no cover def _JSONEncoder__floatstr(self, o: float) -> str: # noqa: N802 return _floatstr(o)