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

Restore file test/myclirc from repository after test writes #930

Merged
merged 1 commit into from
Jan 5, 2021

Conversation

rolandwalker
Copy link
Contributor

Description

This test

@dbtest
def test_favorite_query():
with db_connection().cursor() as cur:
query = u'select "✔"'
mycli.packages.special.execute(cur, u'\\fs check {0}'.format(query))
assert next(mycli.packages.special.execute(
cur, u'\\f check'))[0] == "> " + query

writes to test/myclirc, leaving it "modified" in the worktree, according to git status, after the test suite is run.

We can simply check out a fresh copy of the file after running the tests. If the git executable is not present, or the code is not in a checked-out repository, the command will silently fail.

Checklist

  • [ ] I've added this contribution to the changelog.md. (no need, internal-facing)
  • I've added my name to the AUTHORS file (or it's already there).

@rolandwalker rolandwalker self-assigned this Jan 5, 2021
@amjith
Copy link
Member

amjith commented Jan 5, 2021

🍍

@amjith amjith merged commit a3c7abb into master Jan 5, 2021
@amjith amjith deleted the RW/tests-restore-local-myclirc branch January 5, 2021 17:45
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

Successfully merging this pull request may close these issues.

2 participants