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-108303: Move all inspect test files to `test_inspect/` by sobolevn · Pull Request #109607 · python/cpython

Conversation

@sobolevn

@sobolevn sobolevn commented Sep 20, 2023 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

This PR also moves ready_to_import helper to test/support/import_helper, because test_inspect was importing test_import, which is not good at all.

  • Issue: Move test files into test subdirectories #108303

Sorry, something went wrong.

Uh oh!

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

All reactions
@sobolevn
pythongh-108303: Move all inspect test files to test_inspect/
83b6a1d
@sobolevn
sobolevn requested a review from vstinner September 20, 2023 12:43
@sobolevn
sobolevn requested review from brettcannon, ericsnowcurrently, ncoghlan and warsaw as code owners September 20, 2023 12:43
@bedevere-app bedevere-app Bot added the awaiting review label Sep 20, 2023
@bedevere-app bedevere-app Bot mentioned this pull request Sep 20, 2023
Move test files into test subdirectories #108303
Closed
@sobolevn sobolevn added tests Tests in the Lib/test dir skip news labels Sep 20, 2023
@sobolevn

sobolevn commented Sep 20, 2023

Copy link
Copy Markdown
Member Author

Looks like there's one more hidden dependency: in test.test_tokenize.TestRoundtrip.test_random_files

All reactions

Sorry, something went wrong.

Uh oh!

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

@sobolevn
Update test_tokenize
9e35f08
@sobolevn
sobolevn requested review from lysnikolaou and pablogsal as code owners September 20, 2023 13:15
vstinner
vstinner reviewed Sep 20, 2023
View reviewed changes

@vstinner vstinner left a comment

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.

Can you please try with a first PR to move ready_to_import() to test.support?

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Lib/test/support/import_helper.py Resolved

Uh oh!

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

Comment thread Lib/test/support/import_helper.py Resolved

Uh oh!

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

brettcannon
brettcannon reviewed Sep 20, 2023
View reviewed changes
Comment thread Lib/test/support/import_helper.py Resolved

Uh oh!

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

This was referenced Sep 20, 2023
Move test.test_import._ready_to_import helper to test.support.import_helper #109625
Closed
gh-109625: Move _ready_to_import from test_import to import_helper #109626
Merged
@sobolevn
Merge
077ded8
vstinner
vstinner reviewed Sep 21, 2023
View reviewed changes
Comment thread Lib/test/test_inspect/test_inspect.py Resolved

Uh oh!

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

Comment thread Lib/test/test_tokenize.py Resolved

Uh oh!

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

@sobolevn
Address review
8d791b9
vstinner
vstinner approved these changes Sep 21, 2023
View reviewed changes

@vstinner vstinner left a comment

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.

LGTM.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Lib/test/test_inspect/__init__.py


def load_tests(*args):
return support.load_package_tests(os.path.dirname(__file__), *args)

@vstinner vstinner Sep 21, 2023

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.

@serhiy-storchaka: It would be nice if we could magically generate such function, instead of having to duplicate the same 4 lines in each test_xxx/ test package. Do you think that it would be possible?

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-app bedevere-app Bot added awaiting core review and removed awaiting review labels Sep 21, 2023
@vstinner

vstinner commented Sep 21, 2023

Copy link
Copy Markdown
Member

This change is LGTM, but I would to wait until #109626 is backported to 3.11. If the backport queue is too big, it becomes really complicated to handle it :-(

sobolevn reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@sobolevn sobolevn added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Sep 22, 2023
@sobolevn
Merge
44bd378
@sobolevn

sobolevn commented Oct 10, 2023

Copy link
Copy Markdown
Member Author

I've solved conflicts, it should be now good to go, since all backports are done.
Thanks a lot, @vstinner, for your help!

All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner

vstinner commented Oct 10, 2023

Copy link
Copy Markdown
Member

Before:

$ ./python -m test test_inspect
...
Total duration: 1.4 sec
Total tests: run=287
Total test files: run=1/1

After:

$ ./python -m test test_inspect
...
Total duration: 1.3 sec
Total tests: run=287
Total test files: run=1/1

Same number of tests: good. And tests pass :-)

All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner
vstinner merged commit 732532b into python:main Oct 10, 2023
@miss-islington

miss-islington commented Oct 10, 2023

Copy link
Copy Markdown
Contributor

Thanks @sobolevn for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot removed the awaiting core review label Oct 10, 2023
@miss-islington

miss-islington commented Oct 10, 2023

Copy link
Copy Markdown
Contributor

Sorry, @sobolevn and @vstinner, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 732532b0af9d1b5c7ae4932526c8d20d86c15507 3.12
All reactions

Sorry, something went wrong.

Uh oh!

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

@miss-islington miss-islington assigned vstinner Oct 10, 2023
@miss-islington

miss-islington commented Oct 10, 2023

Copy link
Copy Markdown
Contributor

Sorry, @sobolevn and @vstinner, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 732532b0af9d1b5c7ae4932526c8d20d86c15507 3.11
All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner

vstinner commented Oct 10, 2023

Copy link
Copy Markdown
Member

@sobolevn: Thanks. I merged your PR. But the thing couldn't be backported automatically. Can you please try to backport the change manually to 3.12?

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot

bedevere-bot commented Oct 10, 2023

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x SLES 3.x has failed when building commit 732532b.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/540/builds/6819) and take a look at the build logs.
  4. Check if the failure is related to this commit (732532b) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/540/builds/6819

Failed tests:

  • test.test_concurrent_futures.test_shutdown

Failed subtests:

  • test_interpreter_shutdown - test.test_concurrent_futures.test_shutdown.ProcessPoolForkProcessPoolShutdownTest.test_interpreter_shutdown

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Lib/test/test_concurrent_futures/test_shutdown.py", line 50, in test_interpreter_shutdown
    self.assertEqual(out.strip(), b"apple")
AssertionError: b'' != b'apple'
All reactions

Sorry, something went wrong.

Uh oh!

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

@sobolevn

sobolevn commented Oct 10, 2023

Copy link
Copy Markdown
Member Author

Working on it.

vstinner reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot

bedevere-bot commented Oct 10, 2023

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot PPC64LE RHEL7 3.x has failed when building commit 732532b.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/446/builds/4013) and take a look at the build logs.
  4. Check if the failure is related to this commit (732532b) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/446/builds/4013

Failed tests:

  • test.test_multiprocessing_fork.test_processes

Summary of the results of the build (if available):

==

Click to see traceback logs
remote: Enumerating objects: 12, done.        
remote: Counting objects:   9% (1/11)        
remote: Counting objects:  18% (2/11)        
remote: Counting objects:  27% (3/11)        
remote: Counting objects:  36% (4/11)        
remote: Counting objects:  45% (5/11)        
remote: Counting objects:  54% (6/11)        
remote: Counting objects:  63% (7/11)        
remote: Counting objects:  72% (8/11)        
remote: Counting objects:  81% (9/11)        
remote: Counting objects:  90% (10/11)        
remote: Counting objects: 100% (11/11)        
remote: Counting objects: 100% (11/11), done.        
remote: Compressing objects:  11% (1/9)        
remote: Compressing objects:  22% (2/9)        
remote: Compressing objects:  33% (3/9)        
remote: Compressing objects:  44% (4/9)        
remote: Compressing objects:  55% (5/9)        
remote: Compressing objects:  66% (6/9)        
remote: Compressing objects:  77% (7/9)        
remote: Compressing objects:  88% (8/9)        
remote: Compressing objects: 100% (9/9)        
remote: Compressing objects: 100% (9/9), done.        
remote: Total 12 (delta 2), reused 7 (delta 2), pack-reused 1        
From https://github.com/python/cpython
 * branch            main       -> FETCH_HEAD
Note: checking out '732532b0af9d1b5c7ae4932526c8d20d86c15507'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 732532b... gh-108303: Move all inspect test files to `test_inspect/` (#109607)
Switched to and reset branch 'main'

make: *** [Makefile:2014: buildbottest] Error 5
All reactions

Sorry, something went wrong.

Uh oh!

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

sobolevn added a commit to sobolevn/cpython that referenced this pull request Oct 11, 2023
@sobolevn
[3.12] pythongh-108303: Move all inspect test files to test_inspect/ (
f0002fe
pythonGH-109607)

(cherry picked from commit 732532b)

Co-authored-by: Nikita Sobolev <[email protected]>
@bedevere-app

bedevere-app Bot commented Oct 11, 2023

Copy link
Copy Markdown

GH-110732 is a backport of this pull request to the 3.12 branch.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Oct 11, 2023
vstinner pushed a commit that referenced this pull request Oct 13, 2023
@sobolevn
[3.12] gh-108303: Move all inspect test files to test_inspect/ (GH-…
0102faf
…109607) (#110732)

(cherry picked from commit 732532b)
sobolevn added a commit to sobolevn/cpython that referenced this pull request Oct 31, 2023
@sobolevn
[3.11] pythongh-108303: Move all inspect test files to test_inspect/ (
4ba0d4e
pythonGH-109607)
@bedevere-app

bedevere-app Bot commented Oct 31, 2023

Copy link
Copy Markdown

GH-111543 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.

@bedevere-app bedevere-app Bot removed the needs backport to 3.11 only security fixes label Oct 31, 2023
vstinner pushed a commit that referenced this pull request Oct 31, 2023
@sobolevn
[3.11] gh-108303: Move all inspect test files to test_inspect/ (GH-…
bc9f470
…109607) (#111543)
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
@sobolevn @Glyphack
pythongh-108303: Move all inspect test files to test_inspect/ (pyth…
7d361e0
…on#109607)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@brettcannon brettcannon brettcannon left review comments
@vstinner vstinner vstinner approved these changes
@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently is a code owner
@ncoghlan ncoghlan Awaiting requested review from ncoghlan ncoghlan is a code owner
@warsaw warsaw Awaiting requested review from warsaw warsaw is a code owner
@pablogsal pablogsal Awaiting requested review from pablogsal pablogsal is a code owner
@lysnikolaou lysnikolaou Awaiting requested review from lysnikolaou lysnikolaou is a code owner

Uh oh!

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

Assignees

@vstinner vstinner

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

@sobolevn @vstinner @miss-islington @bedevere-bot @brettcannon
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.