Skip to content

Commit

Permalink
fix "run-on-arch" tests (#1131)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt committed Dec 21, 2023
1 parent 0cb382b commit 126a165
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -643,11 +643,11 @@ jobs:
if command -v apt-get &> /dev/null; then
echo "installing python & pip with apt-get..."
apt-get update
apt-get install -y --no-install-recommends python3 python3-pip python3-venv
apt-get install -y --no-install-recommends python3 python3-pip python3-venv git
else
echo "installing python & pip with apk..."
apk update
apk add python3 py3-pip
apk add python3 py3-pip git
fi
run: |
set -x
Expand Down
4 changes: 3 additions & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ pandas==2.0.3; python_version >= "3.9" and python_version < "3.12" and implement
pytest==7.4.3
# we run codspeed benchmarks on x86_64 CPython (i.e. native github actions architecture)
pytest-codspeed~=2.2.0; implementation_name == "cpython" and platform_machine == 'x86_64'
pytest-examples==0.0.10
# pytest-examples currently depends on aiohttp via black; we don't want to build
# it on platforms like aarch64 musllinux in CI
pytest-examples==0.0.10; implementation_name == "cpython" and platform_machine == 'x86_64'
pytest-speed==0.3.5
pytest-mock==3.11.1
pytest-pretty==1.2.0
Expand Down
4 changes: 2 additions & 2 deletions tests/test_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def find_examples(*_directories):
return []


@pytest.mark.skipif(sys.platform not in {'linux', 'darwin'}, reason='Only on linux and macos')
@pytest.mark.skipif(CodeExample is None or sys.platform not in {'linux', 'darwin'}, reason='Only on linux and macos')
@pytest.mark.parametrize('example', find_examples('python/pydantic_core/core_schema.py'), ids=str)
def test_docstrings(example: CodeExample, eval_example: EvalExample):
eval_example.set_config(quotes='single')
Expand All @@ -25,7 +25,7 @@ def test_docstrings(example: CodeExample, eval_example: EvalExample):
eval_example.run_print_check(example)


@pytest.mark.skipif(sys.platform not in {'linux', 'darwin'}, reason='Only on linux and macos')
@pytest.mark.skipif(CodeExample is None or sys.platform not in {'linux', 'darwin'}, reason='Only on linux and macos')
@pytest.mark.parametrize('example', find_examples('README.md'), ids=str)
def test_readme(example: CodeExample, eval_example: EvalExample):
eval_example.set_config(line_length=100, quotes='single')
Expand Down

0 comments on commit 126a165

Please sign in to comment.