Skip to content
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
Closed

Setup and teardown files #589

hadley opened this issue May 3, 2017 · 5 comments

Comments

@hadley
Copy link
Member

@hadley 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
Copy link
Contributor

@gaborcsardi gaborcsardi commented May 3, 2017

Might or might not be useful: https://github.com/hadley/testthat/pull/158

@hadley
Copy link
Member Author

@hadley hadley commented May 3, 2017

Oh yeah, just like that 😬

@kimyen
Copy link

@kimyen 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.

@hadley hadley changed the title teardown- prefix Setup and teardown files Oct 1, 2017
@hadley
Copy link
Member Author

@hadley 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
Copy link
Contributor

@gaborcsardi 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.