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

gh-90916: Improve readability of expected Instruction lists in test_dis #96470

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

martindemello
Copy link
Contributor

@martindemello martindemello commented Sep 1, 2022

  • Use a table with aligned elements rather than a list of
    Instruction(key=value, ...) constructors
  • Don't specify positions=None since it never changes.
  • Shorten overly-long string literals in test code.
  • Fix the one test that depends on its own line number.

…test_dis

* Use a table with aligned elements rather than a list of
  `Instruction(key=value, ...)` constructors
* Don't specify `positions=None` since it never changes.
* Shorten overly-long string literals in test code.
* Fix the one test that depends on its own line number.
@bedevere-bot bedevere-bot added the tests Tests in the Lib/test dir label Sep 1, 2022
@bedevere-bot
Copy link

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

@cpython-cla-bot
Copy link

cpython-cla-bot bot commented Sep 1, 2022

All commit authors signed the Contributor License Agreement.
CLA signed

Lib/test/test_dis.py Outdated Show resolved Hide resolved
Lib/test/test_dis.py Show resolved Hide resolved
Copy link
Member

@gpshead gpshead left a comment

Choose a reason for hiding this comment

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

merging will be a pain, if i were making this transformation i'd get overly creative with a vim macro and just rerun that to do it. I looped in recent code owners who've been working on bytecode performance work for opinion reviews. (Irit & Mark)

@martindemello
Copy link
Contributor Author

merging will be a pain, if i were making this transformation i'd get overly creative with a vim macro and just rerun that to do it. I looped in recent code owners who've been working on bytecode performance work for opinion reviews. (Irit & Mark)

yeah, i'll just regenerate it from the current version

Lib/test/test_dis.py Outdated Show resolved Hide resolved
Lib/test/test_dis.py Outdated Show resolved Hide resolved
@iritkatriel iritkatriel added the 3.12 bugs and security fixes label Sep 12, 2022
Copy link
Member

@iritkatriel iritkatriel left a comment

Choose a reason for hiding this comment

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

LGTM.

@iritkatriel
Copy link
Member

There's a test failure due to some whitespace issues. Try running patchcheck on your branch.

https://dev.azure.com/Python/cpython/_build/results?buildId=111592&view=logs&j=256d7e09-002a-52d7-8661-29ee3960640e&t=3d7276d3-4e8d-5309-55ad-fb0b172d9925

@martindemello
Copy link
Contributor Author

done

Lib/test/test_dis.py Outdated Show resolved Hide resolved
Copy link
Member

@markshannon markshannon left a comment

Choose a reason for hiding this comment

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

Ultimately we want to separate the tests for compiler output from the tests for dis behavior.
This is definitely a step in the right direction.

One minor formatting issue, otherwise looks good.

Lib/test/test_dis.py Outdated Show resolved Hide resolved
@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 bugs and security fixes awaiting changes tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants