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

Setup and teardown files #589

Closed
hadley opened this Issue May 3, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@hadley
Member

hadley commented May 3, 2017

These functions would be run at the end of the all the tests. Would not be sourced by load_all()

@gaborcsardi

This comment has been minimized.

Member

gaborcsardi commented May 3, 2017

Might or might not be useful: #158

@hadley

This comment has been minimized.

Member

hadley commented May 3, 2017

Oh yeah, just like that 😬

@kimyen

This comment has been minimized.

kimyen commented Sep 22, 2017

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.

@kimyen kimyen referenced this issue Sep 22, 2017

Merged

SYNR-1128 #4

@hadley hadley changed the title from teardown- prefix to Setup and teardown files Oct 1, 2017

@hadley

This comment has been minimized.

Member

hadley commented Oct 1, 2017

Maybe we should also add setup- prefix which would be run only by testthat, not by devtools::load_all().

@gaborcsardi

This comment has been minimized.

Member

gaborcsardi commented Oct 2, 2017

@hadley Yeah, probably. I am really not sure what you want for load_all().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment