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

Check if a file has changed before overwriting #14

Closed
max-sixty opened this issue Aug 19, 2021 · 1 comment
Closed

Check if a file has changed before overwriting #14

max-sixty opened this issue Aug 19, 2021 · 1 comment

Comments

@max-sixty
Copy link
Owner

As discussed in the readme, currently pytest-accept will overwrite a file unless --accept-copy is passed.

Generally that's fine. But recently I've been using it as a realtime tool recently (i.e. it runs with pytest -f --accept, running on every save), which is really cool. And it requires pausing on each save for it to generate and write new results, and getting that wrong causes an overwrite and resolving the change in an editor (or losing it), which can get confusing, even if it's only a couple of seconds of changes.

I think by default it should check that the file hasn't changed before overwriting. If it's changed, it still fails the test as it would otherwise, and prints a message saying it didn't overwrite and suggesting to run again

@max-sixty
Copy link
Owner Author

Closed by #17

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