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

In Windows tests, unlinking test DB does not work #62

Open
andybega opened this issue May 26, 2020 · 0 comments
Open

In Windows tests, unlinking test DB does not work #62

andybega opened this issue May 26, 2020 · 0 comments

Comments

@andybega
Copy link
Owner

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 as test.sqlite3. Unlinking this file for some reason does not work on Windows, which causes an error the next time setup_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 time setup_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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant