ShawHahnLab/chiimp

Tests using png("/dev/null") fail with bitmapType quartz

Opened this issue · 0 comments

ressy commented

I have some tests for plotting functions that use the equivalent of:

png("/dev/null")
doSomething()
dev.off()

...but on Mac OS this fails with:

Error in dev.off() : 
  QuartzBitmap_Output - unable to open file '/dev/null'

Using cairo (with options(bitmapType = "cairo") or png(..., type = "cairo")), like I see on Linux as the default, does fine. Alternatively a temporary file might be the better way to go. That would also test that the plotting doesn't fail with a platform's default bitmap device. There's already within_tmpdir in the test helpers that could be useful.