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

Add in_snapshotter() and return conditions visibly when snapshotting #1505

Conversation

DavisVaughan
Copy link
Member

@DavisVaughan DavisVaughan commented Dec 2, 2021

This is currently broken, because in_snapshotter() seems to always return TRUE when testing a file or directory, and always return FALSE when running a test interactively. Both of these are incorrect.

We need something that is more fine grained. I think expect_snapshot() itself might need to set something that announces that you are "in a snapshot expectation". That would mean that both interactive and non-interactive testing could return visible conditions where appropriate.

This is currently broken, because `in_snapshotter()` seems to always return `TRUE` when testing a file or directory
@hadley
Copy link
Member

hadley commented Jan 4, 2022

I'm now having second thoughts about conditionally changing the visibility depending on whether or not you're in a snapshot or not. It just feels a bit too magical. What do you think?

@hadley
Copy link
Member

hadley commented Jan 4, 2022

Part of #1471

@DavisVaughan
Copy link
Member Author

If we need to continue wrapping expect_error() in another set of parenthesis to avoid this feeling too magical, that is okay with me.

I would like to avoid seeing the err() wrapper in too many places, I'd rather be explicit about the (expect_error()) pattern
(mentioned in #1471 (comment))

@hadley hadley closed this Jan 5, 2022
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