Skip to content

Commit

Permalink
Merge pull request #411 from olemke/fix-tests
Browse files Browse the repository at this point in the history
Fix test issues
  • Loading branch information
olemke authored Sep 16, 2022
2 parents e6b2cd6 + 4d1af14 commit dfacd16
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

include:
- name: ubuntu
os: ubuntu-18.04
os: ubuntu-latest

- name: windows
os: windows-latest
Expand Down Expand Up @@ -62,5 +62,6 @@ jobs:
- name: Test (Windows)
if: runner.os == 'Windows'
run: |
$Env:HDF5_DISABLE_VERSION_CHECK = 1
$Env:TYPHONTESTFILES = Join-Path $pwd "typhon-testfiles"
pytest --pyargs typhon
8 changes: 4 additions & 4 deletions typhon/tests/files/test_fileset.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import os
from os.path import dirname
from posixpath import join # LocalFileSystem always uses /

import datetime
import numpy as np
import pytest
import shutil
import logging

from typhon.files import FileHandler, FileInfo, FileSet, FileSetManager
Expand All @@ -30,8 +28,10 @@ def file_system(self, request, tmp_path):
from shutil import make_archive
# prepare archive to test on
archive = tmp_path / "test"
shutil.make_archive(
archive, "zip", os.curdir, self.refdir)
make_archive(
archive, "zip", "/" if os.path.isabs(self.refdir) else os.curdir,
self.refdir)

return ZipFileSystem(archive.with_suffix(".zip"))
elif request.param == "local":
from fsspec.implementations.local import LocalFileSystem
Expand Down
4 changes: 2 additions & 2 deletions typhon/tests/plots/test_colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def test_cmap_from_txt(self):
viridis = plt.get_cmap('viridis')

cmap = colors.cmap_from_txt(os.path.join(
self.ref_dir, 'viridis.txt'), name="viridis_read")
self.ref_dir, 'viridis.txt'), name="viridis_read_txt")

assert np.allclose(viridis(idx), cmap(idx), atol=0.001)

Expand All @@ -103,7 +103,7 @@ def test_cmap_from_act(self):
viridis = plt.get_cmap('viridis')

cmap = colors.cmap_from_act(
os.path.join(self.ref_dir, 'viridis.act'), name="viridis_read")
os.path.join(self.ref_dir, 'viridis.act'), name="viridis_read_act")

assert np.allclose(viridis(idx), cmap(idx), atol=0.004)

Expand Down

0 comments on commit dfacd16

Please sign in to comment.