Skip to content

Commit

Permalink
conditional rhdf5 testing
Browse files Browse the repository at this point in the history
  • Loading branch information
dansmith01 committed Jan 23, 2025
1 parent e4799c8 commit 9ed94ca
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
14 changes: 8 additions & 6 deletions tests/testthat/test-read_biom.r
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ test_that("read_biom", {
expect_silent(read_biom(src = g))
unlink(c(f, g))

f <- expect_silent(write_biom(hmp5, tempfile(), 'hdf5'))
g <- expect_silent(write_biom(min5, tempfile(), 'hdf5'))
expect_silent(read_biom(src = f))
expect_silent(read_biom(src = g))
unlink(c(f, g))

f <- expect_silent(write_biom(hmp5, tempfile(fileext = '.gz'), 'tab'))
g <- expect_silent(write_biom(min5, tempfile(fileext = '.gz'), 'tab'))
expect_silent(read_biom(src = f))
Expand Down Expand Up @@ -41,4 +35,12 @@ test_that("read_biom", {

expect_null(parse_json_sequences(list(rows = list(list(metadata=list())))))
expect_null(parse_hdf5_sequences(list(observation = list(list(metadata=list())))))


skip_if_not_installed('rhdf5')
f <- expect_silent(write_biom(hmp5, tempfile(), 'hdf5'))
g <- expect_silent(write_biom(min5, tempfile(), 'hdf5'))
expect_silent(read_biom(src = f))
expect_silent(read_biom(src = g))
unlink(c(f, g))
})
9 changes: 5 additions & 4 deletions tests/testthat/test-write_biom.r
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ test_that(desc = "write_biom", code = {

skip_on_cran()

expect_silent(write_biom(hmp5, tfile, format = "hdf5"))
expect_silent(read_biom(tfile))
unlink(tfile)


expect_silent(write_counts(hmp5, tfile)); unlink(tfile)
expect_silent(write_metadata(hmp5, tfile)); unlink(tfile)
Expand All @@ -42,4 +38,9 @@ test_that(desc = "write_biom", code = {
unlink(c(gzfile, bzfile))


skip_if_not_installed('rhdf5')
expect_silent(write_biom(hmp5, tfile, format = "hdf5"))
expect_silent(read_biom(tfile))
unlink(tfile)

})

0 comments on commit 9ed94ca

Please sign in to comment.