-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
Some test modules fail when run as a script #104057
Comments
I grepped with IDLE for other candidates to fix.
This caught the test_module line you just fixed. Some of these are in interactive output and I don't know if they will fail. |
Yeah, I saw these lines, and this should be discussed. Otherwise, I found some another scenarios with the same issue (easy to fix). |
However, I'll try to run file |
main built yesterday
Crash. Rebuild and try again. Same crash. "Debug assertion Failed." |
Thanks! import os
def make_bad_fd():
file = open("test_file.txt", "wb")
try:
return file.fileno()
finally:
file.close()
fd = make_bad_fd()
os.write(fd, b"foo") |
Running test_support from IDLE editor: get same Assertion Failure box. After Ignore, failure is
|
That's easy to fix. Just replace cls._test_support_token = support.ignore_deprecations_from(
"test.test_support", like=".*You should NOT be seeing this.*"
) to this: cls._test_support_token = support.ignore_deprecations_from(
__main__, like=".*You should NOT be seeing this.*"
) |
* main: (463 commits) pythongh-104057: Fix direct invocation of test_super (python#104064) pythongh-87092: Expose assembler to unit tests (python#103988) pythongh-97696: asyncio eager tasks factory (python#102853) pythongh-84436: Immortalize in _PyStructSequence_InitBuiltinWithFlags() (pythongh-104054) pythongh-104057: Fix direct invocation of test_module (pythonGH-104059) pythongh-100458: Clarify Enum.__format__() change of mixed-in types in the whatsnew/3.11.rst (pythonGH-100387) pythongh-104018: disallow "z" format specifier in %-format of byte strings (pythonGH-104033) pythongh-104016: Fixed off by 1 error in f string tokenizer (python#104047) pythonGH-103629: Update Unpack's repr in compliance with PEP 692 (python#104048) pythongh-102799: replace sys.exc_info by sys.exception in inspect and traceback modules (python#104032) Fix typo in "expected" word in few source files (python#104034) pythongh-103824: fix use-after-free error in Parser/tokenizer.c (python#103993) pythongh-104035: Do not ignore user-defined `__{get,set}state__` in slotted frozen dataclasses (python#104041) pythongh-104028: Reduce object creation while calling callback function from gc (pythongh-104030) pythongh-104036: Fix direct invocation of test_typing (python#104037) pythongh-102213: Optimize the performance of `__getattr__` (pythonGH-103761) pythongh-103895: Improve how invalid `Exception.__notes__` are displayed (python#103897) Adjust expression from `==` to `!=` in alignment with the meaning of the paragraph. (pythonGH-104021) pythongh-88496: Fix IDLE test hang on macOS (python#104025) Improve int test coverage (python#104024) ...
Signed-off-by: Pablo Galindo <[email protected]>
Signed-off-by: Pablo Galindo <[email protected]>
Same is for
|
Please, read the #104070, I think you got the same problem |
Yep, you're right. A lot of modules still fail for other reasons though. |
If you run a test directly, such as
all remain set to their default values. The assertion and error report types default to showing a dialog box, while the warning report type defaults to outputting a message to an attached debugger, if any. For example: >>> from msvcrt import *
>>> CrtSetReportMode(CRT_ASSERT, CRTDBG_REPORT_MODE) == CRTDBG_MODE_WNDW
True
>>> CrtSetReportMode(CRT_ERROR, CRTDBG_REPORT_MODE) == CRTDBG_MODE_WNDW
True
>>> CrtSetReportMode(CRT_WARN, CRTDBG_REPORT_MODE) == CRTDBG_MODE_DEBUG
True On the other hand, if you run the main test suite normally, such as One step that's missing is to explicitly configure the report mode for the standard |
You're running the tests incorrectly for how the debug build is supported on Windows. The debug CRT report modes are not set for each individual test, except in test cases that explicitly use the |
@eryksun, are you replying to me? I use Linux, so I guess that none of errors that I mentioned above relate to how test output is handled by system, and most of them happen regardless of |
* main: (760 commits) pythonGH-104102: Optimize `pathlib.Path.glob()` handling of `../` pattern segments (pythonGH-104103) pythonGH-104104: Optimize `pathlib.Path.glob()` by avoiding repeated calls to `os.path.normcase()` (pythonGH-104105) pythongh-103822: [Calendar] change return value to enum for day and month APIs (pythonGH-103827) pythongh-65022: Fix description of tuple return value in copyreg (python#103892) pythonGH-103525: Improve exception message from `pathlib.PurePath()` (pythonGH-103526) pythongh-84436: Add integration C API tests for immortal objects (pythongh-103962) pythongh-103743: Add PyUnstable_Object_GC_NewWithExtraData (pythonGH-103744) pythongh-102997: Update Windows installer to SQLite 3.41.2. (python#102999) pythonGH-103484: Fix redirected permanently URLs (python#104001) Improve assert_type phrasing (python#104081) pythongh-102997: Update macOS installer to SQLite 3.41.2. (pythonGH-102998) pythonGH-103472: close response in HTTPConnection._tunnel (python#103473) pythongh-88496: IDLE - fix another test on macOS (python#104075) pythongh-94673: Hide Objects in PyTypeObject Behind Accessors (pythongh-104074) pythongh-94673: Properly Initialize and Finalize Static Builtin Types for Each Interpreter (pythongh-104072) pythongh-104016: Skip test for deeply neste f-strings on wasi (python#104071) pythongh-104057: Fix direct invocation of test_super (python#104064) pythongh-87092: Expose assembler to unit tests (python#103988) pythongh-97696: asyncio eager tasks factory (python#102853) pythongh-84436: Immortalize in _PyStructSequence_InitBuiltinWithFlags() (pythongh-104054) ...
* main: pythongh-104057: Fix direct invocation of test_support (pythonGH-104069) pythongh-87729: improve hit rate of LOAD_SUPER_ATTR specialization (python#104270) pythongh-101819: Fix inverted debug preprocessor check in winconsoleio.c (python#104388)
Thanks for the fixes! Anything left here, or okay to close? |
I think we did everything we had to do :) |
I'll soon send a PR to fix it.
Linked PRs
The text was updated successfully, but these errors were encountered: