8000 gh-118079: Fix ``requires_singlephase_init`` helper by Eclips4 · Pull Request #118081 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-118079: Fix requires_singlephase_init helper #118081

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

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

Eclips4
Copy link
Member
@Eclips4 Eclips4 commented Apr 19, 2024

Before this PR tests which decorated with a requires_singlephase_init helper simply did not run because of an incorrect call to the requires_gil_enabled helper.

@Eclips4
Copy link
Member Author
Eclips4 commented Apr 19, 2024

Before this pr:
Default debug build:

./python.exe -m test -v test_import -m test_disallowed_reimport
== CPython 3.13.0a6+ (heads/issue-118079:f6225f5075, Apr 19 2024, 09:10:18) [Clang 15.0.0 (clang-1500.1.0.2.5)]
== macOS-14.2.1-arm64-arm-64bit-Mach-O little-endian
== Python build: debug
== cwd: /Users/admin/Projects/cpython/build/test_python_worker_28793æ
== CPU count: 8
== encodings: locale=UTF-8 FS=utf-8
== resources: all test resources are disabled, use -u option to unskip tests

Using random seed: 2142684577
0:00:00 load avg: 6.36 Run 1 test sequentially
0:00:00 load avg: 6.36 [1/1] test_import
test_disallowed_reimport (test.test_import.SubinterpImportTests.test_disallowed_reimport) ... /Users/admin/Projects/cpython/Lib/unittest/case.py:707: DeprecationWarning: It is deprecated to return a value that is not None from a test case (<bound method _id of <test.test_import.SubinterpImportTests testMethod=test_disallowed_reimport>>)
  return self.run(*args, **kwds)
ok

----------------------------------------------------------------------
Ran 1 test in 0.002s

OK

== Tests result: SUCCESS ==

1 test OK.

Total duration: 390 ms
Total tests: run=1 (filtered)
Total test files: run=1/1 (filtered)
Result: SUCCESS

Debug free-threaded build:

./python.exe -m test -v test_import -m test_disallowed_reimport
== CPython 3.13.0a6+ (heads/issue-118079:f6225f5075, Apr 19 2024, 09:17:19) [Clang 15.0.0 (clang-1500.1.0.2.5)]
== macOS-14.2.1-arm64-arm-64bit-Mach-O little-endian
== Python build: free_threading debug
== cwd: /Users/admin/Projects/cpython/build/test_python_worker_36806æ
== CPU count: 8
== encodings: locale=UTF-8 FS=utf-8
== resources: all test resources are disabled, use -u option to unskip tests

Using random seed: 2535519029
0:00:00 load avg: 87.40 Run 1 test sequentially
0:00:00 load avg: 87.40 [1/1] test_import
test_disallowed_reimport (test.test_import.SubinterpImportTests.test_disallowed_reimport) ... skipped ''

----------------------------------------------------------------------
Ran 1 test in 0.000s

OK (skipped=1)

== Tests result: SUCCESS ==

1 test OK.

Total duration: 188 ms
Total tests: run=1 (filtered) skipped=1
Total test files: run=1/1 (filtered)
Result: SUCCESS

After this PR:

Default debug build:

./python.exe -m test -v test_import -m test_disallowed_reimport
== CPython 3.13.0a6+ (heads/issue-118079:f6225f5075, Apr 19 2024, 09:10:18) [Clang 15.0.0 (clang-1500.1.0.2.5)]
== macOS-14.2.1-arm64-arm-64bit-Mach-O little-endian
== Python build: debug
== cwd: /Users/admin/Projects/cpython/build/test_python_worker_28862æ
== CPU count: 8
== encodings: locale=UTF-8 FS=utf-8
== resources: all test resources are disabled, use -u option to unskip tests

Using random seed: 3757181916
0:00:00 load avg: 4.83 Run 1 test sequentially
0:00:00 load avg: 4.83 [1/1] test_import
test_disallowed_reimport (test.test_import.SubinterpImportTests.test_disallowed_reimport) ... ok

----------------------------------------------------------------------
Ran 1 test in 0.038s

OK

== Tests result: SUCCESS ==

1 test OK.

Total duration: 232 ms
Total tests: run=1 (filtered)
Total test files: run=1/1 (filtered)
Result: SUCCESS

Debug free-threaded build:

./python.exe -m test -v test_import -m test_disallowed_reimport
== CPython 3.13.0a6+ (heads/issue-118079:f6225f5075, Apr 19 2024, 09:17:19) [Clang 15.0.0 (clang-1500.1.0.2.5)]
== macOS-14.2.1-arm64-arm-64bit-Mach-O little-endian
== Python build: free_threading debug
== cwd: /Users/admin/Projects/cpython/build/test_python_worker_36855æ
== CPU count: 8
== encodings: locale=UTF-8 FS=utf-8
== resources: all test resources are disabled, use -u option to unskip tests

Using random seed: 2460420013
0:00:00 load avg: 38.83 Run 1 test sequentially
0:00:00 load avg: 38.83 [1/1] test_import
test_disallowed_reimport (test.test_import.SubinterpImportTests.test_disallowed_reimport) ... skipped 'gh-117694: free-threaded build does not currently support single-phase init modules in sub-interpreters'

----------------------------------------------------------------------
Ran 1 test in 0.001s

OK (skipped=1)

== Tests result: SUCCESS ==

1 test OK.

Total duration: 411 ms
Total tests: run=1 (filtered) skipped=1
Total test files: run=1/1 (filtered)
Result: SUCCESS

Copy link
Member
@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Thank you!

Copy link
Contributor
@colesbury colesbury left a comment

Choose a reason for hiding this comment

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

Thanks!

@colesbury colesbury merged commit 8d4a244 into python:main Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0