I am looking for this. My use case: I am working on PythonEmbedInR, a fork of PythonInR.
Users of this package may or may not change their option to use pandas (in python). However, I need to test that the functions work when users choose to use pandas.
Before running my tests, I want to install pandas. After the tests ran, I want to remove pandas. I want to install and remove pandas only once.
My current work around is installing pandas using helper.R and removing pandas in testthat.R, after test_check(). It would be much nicer if I can put all the code that remove pandas to a teardown-prefix file.