GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-94808: Coverage: Test uppercase string literal prefixes by mdboom · Pull Request #95925 · python/cpython

Conversation

@mdboom

@mdboom mdboom commented Aug 12, 2022 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
  • Issue: Metabug: Improving C-level coverage #94808

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mdboom
pythongh-94808: Coverage: Test uppercase string literal prefixes
b71ac0e
@bedevere-bot bedevere-bot added tests Tests in the Lib/test dir awaiting review labels Aug 12, 2022
@mdboom mdboom added skip news needs backport to 3.11 only security fixes awaiting review and removed awaiting review labels Aug 12, 2022
@mdboom mdboom mentioned this pull request Aug 12, 2022
Metabug: Improving C-level coverage #94808
Open
@iritkatriel
iritkatriel requested a review from serhiy-storchaka August 25, 2022 19:18
iritkatriel
iritkatriel reviewed Sep 7, 2022
View reviewed changes
Comment thread Lib/test/test_string_literals.py Outdated
self.assertEqual(eval(r""" R'\x01' """), '\\x01')
self.assertEqual(eval(r""" BR'\x01' """), b'\\' + b'x01')
self.assertEqual(eval(""" F'{1+1}' """), '2')
self.assertEqual(eval(""" U'\U0001d120' """), '\U0001d120')

@iritkatriel iritkatriel Sep 7, 2022

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Presumably the lowercase versions are covered by other tests (right?)

Would it be simpler here to just assert in each case that the lowercase and upper case prefixes generate the same thing? For instance, self.assertEqual(eval(""" F'{1+1}' """), eval(""" f'{1+1}' """)).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mdboom mdboom Sep 22, 2022

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

That's a good idea. Updated.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@iritkatriel

iritkatriel commented Sep 7, 2022

Copy link
Copy Markdown
Member

IIUC this is covering the uppercase cases here: http://droettboom.com/cpython-coverage/llvm-coverage/coverage/home/mdboom/Work/builds/cpython/Parser/string_parser.c.html#L183

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mdboom
Simplify tests to just show that they match lowercase versions
ba0f88a
@mdboom
mdboom requested a review from iritkatriel September 22, 2022 14:05
iritkatriel
iritkatriel approved these changes Sep 22, 2022
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting review labels Sep 22, 2022
iritkatriel
iritkatriel reviewed Sep 22, 2022
View reviewed changes
Comment thread Lib/test/test_string_literals.py Outdated
self.assertEqual(eval(r""" R'\x01' """), r'\x01')
self.assertEqual(eval(r""" BR'\x01' """), br'\x01')
self.assertEqual(eval(""" F'{1+1}' """), f'{1+1}')
self.assertEqual(eval(""" U'\U0001d120' """), u'\U0001d120')

@iritkatriel iritkatriel Sep 22, 2022

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Actually do we need the eval() calls?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
serhiy-storchaka
serhiy-storchaka approved these changes Sep 24, 2022
View reviewed changes
serhiy-storchaka
serhiy-storchaka reviewed Sep 24, 2022
View reviewed changes
Comment thread Lib/test/test_string_literals.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@serhiy-storchaka
Update Lib/test/test_string_literals.py
5f64dcc
@serhiy-storchaka
serhiy-storchaka merged commit f00383e into python:main Sep 24, 2022
@miss-islington

miss-islington commented Sep 24, 2022

Copy link
Copy Markdown
Contributor

Thanks @mdboom for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed awaiting merge needs backport to 3.11 only security fixes labels Sep 24, 2022
@bedevere-bot

bedevere-bot commented Sep 24, 2022

Copy link
Copy Markdown

GH-97518 is a backport of this pull request to the 3.11 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 24, 2022
@mdboom @miss-islington
pythongh-94808: Coverage: Test uppercase string literal prefixes (pyt…
cda3a30
…honGH-95925)

(cherry picked from commit f00383e)

Co-authored-by: Michael Droettboom <[email protected]>
miss-islington added a commit that referenced this pull request Sep 25, 2022
@miss-islington @mdboom
gh-94808: Coverage: Test uppercase string literal prefixes (GH-95925)
6daff06
(cherry picked from commit f00383e)

Co-authored-by: Michael Droettboom <[email protected]>
@serhiy-storchaka serhiy-storchaka added the needs backport to 3.10 label Sep 25, 2022
@miss-islington

miss-islington commented Sep 25, 2022

Copy link
Copy Markdown
Contributor

Thanks @mdboom for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the needs backport to 3.10 label Sep 25, 2022
@bedevere-bot

bedevere-bot commented Sep 25, 2022

Copy link
Copy Markdown

GH-97537 is a backport of this pull request to the 3.10 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 25, 2022
@mdboom @miss-islington
pythongh-94808: Coverage: Test uppercase string literal prefixes (pyt…
567fea8
…honGH-95925)

(cherry picked from commit f00383e)

Co-authored-by: Michael Droettboom <[email protected]>
miss-islington added a commit that referenced this pull request Sep 25, 2022
@miss-islington @mdboom
gh-94808: Coverage: Test uppercase string literal prefixes (GH-95925)
00713a8
(cherry picked from commit f00383e)

Co-authored-by: Michael Droettboom <[email protected]>
@mdboom
mdboom deleted the coverage-upper-case-literal-prefixes branch December 22, 2022 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@iritkatriel iritkatriel iritkatriel approved these changes
@serhiy-storchaka serhiy-storchaka serhiy-storchaka approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@mdboom @iritkatriel @miss-islington @bedevere-bot @serhiy-storchaka
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.