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-108303: Move all inspect test files to test_inspect/ #109607

Merged
merged 5 commits into from
Oct 10, 2023

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Sep 20, 2023

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.

@sobolevn
Copy link
Member Author

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

Copy link
Member

@vstinner vstinner left a 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?

Lib/test/support/import_helper.py Outdated Show resolved Hide resolved
Lib/test/support/import_helper.py Outdated Show resolved Hide resolved
Lib/test/test_inspect/test_inspect.py Outdated Show resolved Hide resolved
Lib/test/test_tokenize.py Show resolved Hide resolved
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM.



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

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?

@vstinner
Copy link
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 sobolevn added needs backport to 3.11 only security fixes needs backport to 3.12 bug and security fixes labels Sep 22, 2023
@sobolevn
Copy link
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!

@vstinner
Copy link
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 :-)

@vstinner vstinner merged commit 732532b into python:main Oct 10, 2023
22 checks passed
@miss-islington
Copy link
Contributor

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

@miss-islington
Copy link
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

@miss-islington
Copy link
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

@vstinner
Copy link
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?

@bedevere-bot
Copy link

⚠️⚠️⚠️ 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'

@sobolevn
Copy link
Member Author

Working on it.

@bedevere-bot
Copy link

⚠️⚠️⚠️ 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

sobolevn added a commit to sobolevn/cpython that referenced this pull request Oct 11, 2023
@bedevere-app
Copy link

bedevere-app bot commented Oct 11, 2023

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

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Oct 11, 2023
vstinner pushed a commit that referenced this pull request Oct 13, 2023
sobolevn added a commit to sobolevn/cpython that referenced this pull request Oct 31, 2023
@bedevere-app
Copy link

bedevere-app bot commented Oct 31, 2023

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

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Oct 31, 2023
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants