Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Split test_dis into a directory by separating generated contentย #123361

Open
@sobolevn

Description

@sobolevn

Feature or enhancement

This issue suggests to continue my work on having better tests and better test structure: #108303
Recently we had a big upgrade in test_ast when we splitted the generate tests from the actual tests: #122292

Right now test_dis also has this problem. There are around 300 lines of generated code in test_dis.py.

I suggest to:

  1. Create a test_dis directory
  2. Move generated content to test_dis/snippets.py
  3. Allow ./python.exe Lib/test/test_dis/snippets.py to always output new snippets to simplify the development, we would no longer need to uncomment / comment this line:
    # from test.test_dis import _prepare_test_cases; _prepare_test_cases()
  4. Keep everything else as it is for now, later we can continue to work on test_dis should test the dis module, not everything elseย #90916
  5. Keep the history as much as possible
  6. Create manual backports for this feature to 3.12 and 3.13, so we won't have any problems with backporting bug fixes to test_dis.py

I have a PR ready. Please, take a look and discuss!

Linked PRs

Metadata

Metadata

Assignees

Labels

testsTests in the Lib/test dirtype-refactorCode refactoring (with no changes in behavior)

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions