-
Notifications
You must be signed in to change notification settings - Fork 2
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
In Windows tests, unlinking test DB does not work #62
Comments
andybega
added a commit
that referenced
this issue
May 26, 2020
andybega
added a commit
that referenced
this issue
Jun 2, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On Windows, the test database set up for testthat sometimes does not get deleted when calling
unlink()
. I have no idea why.This is specifically when using
setup_mock_environment()
, which creates the test database astest.sqlite3
. Unlinking this file for some reason does not work on Windows, which causes an error the next timesetup_mock_environment()
is called.As a fix, I'm changing
setup_mock_environment()
to randomly name the test database. That way even if the previous instance cannot be deleted, a new one can be created the next timesetup_mock_environment()
is called.There should after this be one test error remaining, when
remove_db()
is tested. Here the file really needs to be removed.The text was updated successfully, but these errors were encountered: