Skip to content

Commit

Permalink
Fix OSX exception type in test
Browse files Browse the repository at this point in the history
  • Loading branch information
benjeffery authored and mergify[bot] committed Nov 15, 2023
1 parent 2890fae commit aa33167
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ jobs:
/usr/share/miniconda/envs/anaconda-client-env
~/osx-conda
~/.profile
key: ${{ runner.os }}-${{ matrix.python}}-conda-v14-${{ hashFiles('requirements/CI-tests-conda/requirements.txt')}}
key: ${{ runner.os }}-${{ matrix.python}}-conda-v16-${{ hashFiles('requirements/CI-tests-conda/requirements.txt')}}

- name: Install Conda
- name: Install Miniconda with Mamba
uses: conda-incubator/setup-miniconda@v2
if: steps.cache.outputs.cache-hit != 'true'
with:
Expand All @@ -67,6 +67,8 @@ jobs:
channels: conda-forge
channel-priority: strict
auto-update-conda: true
mamba-version: "*"
use-mamba: true

- name: Fix windows .profile
if: steps.cache.outputs.cache-hit != 'true' && matrix.os == 'windows-latest'
Expand All @@ -78,12 +80,12 @@ jobs:
- name: Install compiler from conda
if: steps.cache.outputs.cache-hit != 'true'
shell: bash -l {0} #We need a login shell to get conda
run: conda install --yes c-compiler
run: mamba install --yes c-compiler

- name: Install conda deps
if: steps.cache.outputs.cache-hit != 'true'
shell: bash -l {0} #We need a login shell to get conda
run: conda install --yes --file=requirements/CI-tests-conda/requirements.txt
run: mamba install --yes --file=requirements/CI-tests-conda/requirements.txt

- name: Install cyvcf2 #Fails if done via conda due to no windows support.
if: steps.cache.outputs.cache-hit != 'true' && matrix.os != 'windows-latest'
Expand Down
3 changes: 2 additions & 1 deletion tests/test_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -1841,7 +1841,8 @@ def test_mmap_unwriteable_dir(self):
for genotypes, position in zip(G, positions):
sample_data.add_site(position, genotypes)

with pytest.raises(PermissionError):
# On OSX we sometimes get OSError depending on Pyhton version
with pytest.raises((PermissionError, OSError)):
# Assuming /bin is unwriteable here
tsinfer.generate_ancestors(sample_data, mmap_temp_dir="/bin")

Expand Down

0 comments on commit aa33167

Please sign in to comment.