This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_typing failing on branch 3.10
Type: Stage: resolved
Components: Tests Versions: Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: gvanrossum, kj, mscastanho, sobolevn
Priority: normal Keywords: patch

Created on 2022-01-25 13:08 by mscastanho, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 30886 merged kj, 2022-01-25 14:59
Messages (8)
msg411587 - (view) Author: Matheus Castanho (mscastanho) Date: 2022-01-25 13:08
test_typing on branch 3.10 is failing after GH-30770 [1]

test test_typing failed -- Traceback (most recent call last):
  File "/home/mscastanho/AT/python-next-220124/opt/at-next-16.0-0-alpha/lib64/python3.10/test/test_typing.py", line 3917, in setUpClass
    UserId = NewType('UserId', int)
NameError: name 'NewType' is not defined

Looks like `from typing import NewType` is not needed anymore in this file on the main branch (where this commit originated), but still is for 3.10.

[1] https://github.com/python/cpython/pull/30770
msg411602 - (view) Author: Ken Jin (kj) * (Python committer) Date: 2022-01-25 14:45
Thanks Matheus for the report. I can reproduce this too.

Unrelated: I'm confused why the CI checks passed on 3.10. Furthermore the buildbots aren't complaining.
msg411607 - (view) Author: Nikita Sobolev (sobolevn) * (Python triager) Date: 2022-01-25 15:06
One of the first things to think of: maybe `NewTypeTests` are not executed at all on 3.10?
msg411613 - (view) Author: Ken Jin (kj) * (Python committer) Date: 2022-01-25 15:25
The test correctly fails on the first run in the CI, then skips itself on the second run, tricking the CI into thinking everything's passed. E.g. search for "test_typing" here https://github.com/python/cpython/runs/4902363883?check_suite_focus=true.

As to why it does that, I still have no clue.
msg411616 - (view) Author: Ken Jin (kj) * (Python committer) Date: 2022-01-25 15:31
New changeset 9a7d01046723a8a0a10f9a26702c5e39e73d4414 by Ken Jin in branch '3.10':
[3.10] bpo-46445, bpo-46519: Re-import typing.NewType (GH-30886)
https://github.com/python/cpython/commit/9a7d01046723a8a0a10f9a26702c5e39e73d4414
msg411619 - (view) Author: Nikita Sobolev (sobolevn) * (Python triager) Date: 2022-01-25 15:34
These lines seem suspicious:

```
0:09:12 load avg: 6.37 Re-running failed tests in verbose mode
0:09:12 load avg: 6.37 Re-running test_typing in verbose mode (matching: setUpClass)

1 re-run test:
    test_typing

1 test run no tests:
    test_typing
```

Probably this happens because the failure is in `setupClass` method, not in a test.

When it try to rerun this, it does not do anything. And happily ends the suite.
msg411621 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2022-01-25 15:42
Exactly what I just thought. A bit more research might find a buggy assumption in the test "framework".
msg411622 - (view) Author: Nikita Sobolev (sobolevn) * (Python triager) Date: 2022-01-25 15:43
I filled a new issue: https://bugs.python.org/issue46523
History
Date User Action Args
2022-04-11 14:59:55adminsetgithub: 90677
2022-01-25 15:43:10sobolevnsetmessages: + msg411622
2022-01-25 15:42:40gvanrossumsetnosy: + gvanrossum
messages: + msg411621
2022-01-25 15:34:29sobolevnsetmessages: + msg411619
2022-01-25 15:32:24kjsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2022-01-25 15:31:24kjsetmessages: + msg411616
2022-01-25 15:25:19kjsetmessages: + msg411613
2022-01-25 15:06:25sobolevnsetmessages: + msg411607
2022-01-25 14:59:37kjsetkeywords: + patch
stage: patch review
pull_requests: + pull_request29068
2022-01-25 14:45:25kjsetnosy: + sobolevn, kj
messages: + msg411602
2022-01-25 13:08:28mscastanhocreate