Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test issues #411

Merged
merged 5 commits into from
Sep 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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