From 2b4b0e8774df8ddc06648f55e737da02443b841c Mon Sep 17 00:00:00 2001 From: Ruth Comer <10599679+rcomer@users.noreply.github.com> Date: Fri, 12 Apr 2024 21:00:42 +0100 Subject: [PATCH] TST: add configuration for no-network tests --- .github/workflows/ci-testing.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index b645913f5..88368e4e0 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -13,10 +13,15 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] python-version: [3.9, '3.10', '3.11', '3.12'] shapely-dev: [false] + use-network: [true] include: - os: ubuntu-latest python-version: '3.11' shapely-dev: true + use-network: true + - os: ubuntu-latest + python-version: '3.11' + use-network: false steps: - uses: actions/checkout@v4 @@ -68,6 +73,7 @@ jobs: - name: Testing id: test + if: matrix.use-network # we need to force bash to use line continuations on Windows shell: bash run: | @@ -82,6 +88,15 @@ jobs: --mpl-results-path="cartopy_test_output-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.shapely-dev }}" \ --pyargs cartopy ${EXTRA_TEST_ARGS} + - name: No Network Tests + # Ensure any test that needs network access has been marked as such + if: ${{ ! matrix.use-network }} + run: | + pip install pytest-socket + pytest -rfEsX -n 4 \ + --color=yes \ + --pyargs cartopy -m "not natural_earth and not network" --disable-socket + - name: Coveralls if: steps.coverage.conclusion == 'success' env: