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

Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
a9c7bc0
fixed test_regrtest
MaximGit1 Mar 17, 2025
b875bee
added spec in test.test_pyclbr.py
MaximGit1 Mar 17, 2025
678893f
changed module name when calling test_metaclass.py directly
MaximGit1 Mar 17, 2025
4670696
Merge branch 'main' into fix-for-running-tests-issue-131290
MaximGit1 Mar 17, 2025
3241aeb
added Misc/NEWS
MaximGit1 Mar 17, 2025
5ffd268
Merge branch 'main' into fix-for-running-tests-issue-131290
MaximGit1 Mar 17, 2025
d3cdd6b
Apply review suggestions for test_regrtest
MaximGit1 Mar 19, 2025
682613f
added comment for test_metaclass.py
MaximGit1 Apr 6, 2025
22c996d
refactor(tests): improve structure and naming in test_pyclbr.py
MaximGit1 Apr 6, 2025
6744e91
created news file
MaximGit1 Apr 6, 2025
2509478
Update Misc/NEWS.d/next/Tests/2025-03-17-19-47-27.gh-issue-131290.NyC…
MaximGit1 Apr 6, 2025
fd29fd1
Removed new entry file NEWS
MaximGit1 Apr 6, 2025
a6868a2
Merge remote-tracking branch 'origin/fix-for-running-tests-issue-1312…
MaximGit1 Apr 6, 2025
bef8cc5
local import removed in test_pyclbr.py
MaximGit1 Apr 6, 2025
584e07b
Created contextmanager for temporarily setting __spec__ on __main__ m…
MaximGit1 Apr 6, 2025
9ec71f2
imports order changed
MaximGit1 Apr 6, 2025
2134259
refactored contextmanager
MaximGit1 Apr 7, 2025
cd3f0bb
removed test_pdb_module
MaximGit1 Apr 7, 2025
19e1a3a
changed the order of checks in the test_others function
MaximGit1 Apr 7, 2025
d12e5c6
added comment and ignores
MaximGit1 Apr 7, 2025
9e28fa4
Update Lib/test/test_pyclbr.py
MaximGit1 Apr 7, 2025
ca81976
Merge branch 'main' into fix-for-running-tests-issue-131290
picnixz Apr 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fixed test_regrtest
added environment variable value "PYTHONREGRTEST_UNICODE_GUARD0" when calling the test directly
  • Loading branch information
MaximGit1 committed Mar 17, 2025
commit a9c7bc0acdbec39d1749e0dbd1fc2d94903e0df7
3 changes: 3 additions & 0 deletions Lib/test/test_regrtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1931,6 +1931,8 @@ def test_print_warning(self):

def test_unicode_guard_env(self):
guard = os.environ.get(setup.UNICODE_GUARD_ENV)
# if you run the test directly,
# then look at the if __name__ == '__main__' of this file
self.assertIsNotNone(guard, f"{setup.UNICODE_GUARD_ENV} not set")
if guard.isascii():
# Skip to signify that the env var value was changed by the user;
Expand Down Expand Up @@ -2546,4 +2548,5 @@ def test_test_result_get_state(self):


if __name__ == '__main__':
os.environ['PYTHONREGRTEST_UNICODE_GUARD'] = 'some_value' # for test_unicode_guard_env
unittest.main()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
os.environ['PYTHONREGRTEST_UNICODE_GUARD'] = 'some_value' # for test_unicode_guard_env
unittest.main()
with EnvironmentVarGuard() as env:
# for test_unicode_guard_env
PYTHONREGRTEST_UNICODE_GUARD = "some_value"
unittest.main()

and add some from test.support.os_hepler import EnvironmentVarGuard top-level import. However, I don't know if this is correct to test test_unicode_guard_env like this or if we shouldn't just skip if it we're running it from __main__. Namely, decorate the test with @unittest.skipIf(__name__ == '__main__') cc @vstinner