black/tests/data/preview
Yilei "Dolee" Yang a36878eb2f
Fix an invalid quote escaping bug in f-string expressions (#3509)
Fixes #3506

We can't simply escape the quotes in a naked f-string when merging string groups, because backslashes are invalid.

The quotes in f-string expressions should be toggled (this is safe since quotes can't be reused).

This fix also means implicitly concatenated f-strings with different quotes can now be merged or quote-normalized by changing the quotes used in expressions. e.g.:

```diff
         raise sa_exc.UnboundExecutionError(
             "Could not locate a bind configured on "
-            f'{", ".join(context)} or this Session.'
+            f"{', '.join(context)} or this Session."
         )
```
2023-01-22 05:27:11 -08:00
..
cantfit.py Wrap concatenated strings used as function args in parens (#3307) 2022-10-26 18:03:10 -07:00
comments7.py Add parens around implicit string concatenations where it increases readability (#3162) 2022-08-30 22:52:00 -04:00
comments8.py Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
comments9.py Fix an issue where extra empty lines are added. (#3470) 2022-12-20 17:58:02 -08:00
docstring_preview.py Do not put the closing quotes in a docstring on a separate line (#3430) 2022-12-12 23:56:38 -05:00
format_unicode_escape_seq.py Format hex code in unicode escape sequences in string literals (#2916) 2023-01-22 05:21:09 -08:00
long_dict_values.py Fix an infinite recursion error exposed by #3440 (#3444) 2022-12-16 05:02:41 -08:00
long_strings__edge_case.py Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
long_strings__regression.py Fix an invalid quote escaping bug in f-string expressions (#3509) 2023-01-22 05:27:11 -08:00
long_strings__type_annotations.py Exclude string type annotations from ESP (#3462) 2022-12-20 13:38:35 -08:00
long_strings.py Significantly speedup ESP on large expressions that contain many strings (#3467) 2022-12-23 12:13:45 -08:00
one_element_subscript.py Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
percent_precedence.py Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
prefer_rhs_split_reformatted.py Prefer splitting right hand side of assignment statements. (#3368) 2022-12-15 15:58:51 -08:00
prefer_rhs_split.py Fix some typos (#3474) 2022-12-25 18:39:51 -08:00
remove_await_parens.py Enforce empty lines before classes/functions with sticky leading comments. (#3302) 2022-10-25 18:03:24 -07:00
remove_except_parens.py Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
remove_for_brackets.py Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
remove_newline_after_code_block_open.py Remove newline after code block open (#3035) 2022-06-11 09:55:01 +03:00
return_annotation_brackets.py Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
skip_magic_trailing_comma.py Correctly handle trailing commas that are inside a line's leading non-nested parens (#3370) 2022-11-09 15:08:51 -08:00
trailing_commas_in_leading_parts.py Fix a crash in preview style with assert + parenthesized string. (#3415) 2022-12-10 07:58:45 -08:00
whitespace.py Remove whitespaces of whitespace-only files (#3348) 2022-11-11 20:05:36 -05:00