Skip to content

Commit

Permalink
Skip tests with missing requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
jesper-friis committed Dec 2, 2024
1 parent 668de12 commit 25d0092
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
7 changes: 0 additions & 7 deletions examples/read-csv/main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
try:
import pandas # noqa: F401
import tables # noqa: F401
except ImportError:
import sys
sys.exit(44) # skip this test if pandas is not available

import readcsv # noqa: F401
5 changes: 5 additions & 0 deletions examples/read-csv/readcsv.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
from pathlib import Path

import dlite
from dlite import importskip

importskip("pandas")
importskip("tables")
importskip("yaml")


# Set up some paths
Expand Down
8 changes: 4 additions & 4 deletions storages/python/tests-python/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
from pathlib import Path

import numpy as np

import dlite
from dlite.testutils import importskip

try:
import skimage
except ImportError:
sys.exit(44) # skip test
importskip("scipy")
importskip("skimage")


thisdir = Path(__file__).absolute().parent
Expand Down

0 comments on commit 25d0092

Please sign in to comment.