From cb7a1f2995abc3ed8edbe2752a85a5c331706518 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..2ef0608 100644 --- a/src/hypothesis_jsonschema/_encode.py +++ b/src/hypothesis_jsonschema/_encode.py @@ -9,7 +9,7 @@ PYTHON_IMPLEMENTATION = platform.python_implementation() JSONType = Union[None, bool, float, str, list, Dict[str, Any]] -if PYTHON_IMPLEMENTATION != "PyPy": +if PYTHON_IMPLEMENTATION != "PyPy": # pragma: no cover from json.encoder import _make_iterencode, encode_basestring_ascii # type: ignore else: _make_iterencode = 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)