Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-126028: Add more tests for msvcrt module#126029

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
aisk wants to merge17 commits intopython:main
base:main
Choose a base branch
Loading
fromaisk:msvcrt-more-tests
Open
Changes from1 commit
Commits
Show all changes
17 commits
Select commitHold shift + click to select a range
71d7cc7
Add more tests for msvcrt module
aiskOct 27, 2024
e14193d
Fix typos
aiskOct 27, 2024
f76b823
Fix another two typos
aiskOct 27, 2024
b0f2acc
Improve test
aiskOct 28, 2024
a3f1546
Improve other tests
aiskOct 28, 2024
13d4345
Check the result in some tests
aiskOct 28, 2024
fee526e
Merge branch 'main' into msvcrt-more-tests
serhiy-storchakaJul 13, 2025
c11647c
Update test_GetErrorCode
aiskJul 16, 2025
54ae00e
Improve test_set_error_mode
aiskJul 16, 2025
90b904a
Update test CrtSetReportXxx
aiskJul 16, 2025
79b1e6e
Check if the old is equal to returned in some cases
aiskJul 17, 2025
d70b3ce
Remove some redundant type check
aiskJul 17, 2025
c5c4005
Test with extrem values
aiskJul 17, 2025
62a8389
Fix test
aiskJul 17, 2025
2d794f3
Fix test_GetErrorMode
aiskJul 17, 2025
2fbd2e8
Fix test_SetErrorMode
aiskJul 17, 2025
c3726e1
Fix test_SetErrorMode
aiskJul 18, 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
NextNext commit
Add more tests for msvcrt module
  • Loading branch information
@aisk
aisk committedOct 27, 2024
commit71d7cc7d8f24fbb5b51b47b4f0133de701e7bd9b
24 changes: 23 additions & 1 deletionLib/test/test_msvcrt.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,7 +4,7 @@
import unittest
from textwrap import dedent

from test.support import os_helper, requires_resource
from test.support import os_helper, requires_resource, Py_DEBUG
from test.support.os_helper import TESTFN, TESTFN_ASCII

if sys.platform != "win32":
Expand DownExpand Up@@ -115,6 +115,28 @@ def test_heap_min(self):
except OSError:
pass

def test_GetErrorMode(self):
msvcrt.GetErrorMode()

def test_SetErrorMode(self):
old = msvcrt.SetErrorMode(0)
msvcrt.SetErrorMode(old)

@unittest.skipUnless(Py_DEBUG, "only avialable under debug build")
def test_set_error_mode(self):
old = msvcrt.set_error_mode(msvcrt.OUT_TO_STDERR)
msvcrt.set_error_mode(old)

@unittest.skipUnless(Py_DEBUG, "only avialable under debug build")
def test_CrtSetReportMode(self):
old = msvcrt.CrtSetReportMode(msvcrt.CRT_WARN, msvcrt.CRTDBG_MODE_DEBUG)
msvcrt.CrtSetReportMode(msvcrt.CRT_WARN, old)

@unittest.skipUnless(Py_DEBUG, "only avialable under debug build")
def test_CrtSetReportFile(self):
old = msvcrt.CrtSetReportFile(msvcrt.CRT_WARN, sys.stdout.fileno())
msvcrt.CrtSetReportFile(msvcrt.CRT_WARN, old)


if __name__ == "__main__":
unittest.main()
Loading

[8]ページ先頭

©2009-2025 Movatter.jp