Skip to content

Add tests demonstrating f-strings with debug expressions in replacements that contain escaped characters#14929

Merged
MichaReiser merged 1 commit intomainfrom
micha/fstring-debug-expression-tests
Dec 12, 2024
Merged

Add tests demonstrating f-strings with debug expressions in replacements that contain escaped characters#14929
MichaReiser merged 1 commit intomainfrom
micha/fstring-debug-expression-tests

Conversation

@MichaReiser
Copy link
Copy Markdown
Member

Summary

This PR adds two test cases that were reported in #14766 and #14926

Test Plan

cargo test

@MichaReiser MichaReiser added the internal An internal refactor or improvement label Dec 12, 2024
Comment on lines -180 to -181
let options = PyFormatOptions::from_extension(input_path);
let formatted_code = format_file(&content, &options, input_path);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha, that took me a minute to figure out. We always formatted the code once with the default options even if there's an options file. We don't want that, so I moved it into the else branch`

@MichaReiser MichaReiser enabled auto-merge (squash) December 12, 2024 09:29
@MichaReiser MichaReiser merged commit 82faa9b into main Dec 12, 2024
@MichaReiser MichaReiser deleted the micha/fstring-debug-expression-tests branch December 12, 2024 09:33
@github-actions
Copy link
Copy Markdown
Contributor

ruff-ecosystem results

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal An internal refactor or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant