Skip to content

[3.13] gh-130197: pygettext: Test the --escape option (GH-131902) #132032

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

Merged
merged 1 commit into from
Apr 2, 2025

Conversation

tomasr8
Copy link
Member

@tomasr8 tomasr8 commented Apr 2, 2025

(cherry picked from commit 87d9983)

Ok it wasn't that bad in the end, I just needed to update some of the test code.

…-131902)

(cherry picked from commit 87d9983)

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Comment on lines +404 to +423
def extract_from_snapshots():
snapshots = {
'messages.py': ('--docstrings',),
'fileloc.py': ('--docstrings',),
'docstrings.py': ('--docstrings',),
# == Test character escaping
# Escape ascii and unicode:
'escapes.py': ('--escape',),
# Escape only ascii and let unicode pass through:
('escapes.py', 'ascii-escapes.pot'): (),
}

for filename, args in snapshots.items():
if isinstance(filename, tuple):
filename, output_file = filename
output_file = DATA_DIR / output_file
input_file = DATA_DIR / filename
else:
input_file = DATA_DIR / filename
output_file = input_file.with_suffix('.pot')
Copy link
Member Author

@tomasr8 tomasr8 Apr 2, 2025

Choose a reason for hiding this comment

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

This is almost exactly what we have on main, I just needed to update it a bit to e.g. remove some CLI options that only exist on main, otherwise it's identical.

@tomasr8 tomasr8 requested a review from serhiy-storchaka April 2, 2025 19:46
@serhiy-storchaka serhiy-storchaka enabled auto-merge (squash) April 2, 2025 20:27
@serhiy-storchaka serhiy-storchaka merged commit 2d909c3 into python:3.13 Apr 2, 2025
38 checks passed
@tomasr8 tomasr8 deleted the backport-87d9983-3.13 branch April 2, 2025 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants