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: Add additional tests for new features in `typing.py`
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: AlexWaygood, JelleZijlstra, corona10, gvanrossum, kj, miss-islington, sobolevn
Priority: normal Keywords: patch

Created on 2022-02-08 20:03 by sobolevn, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 31222 merged sobolevn, 2022-02-08 20:04
PR 31223 merged sobolevn, 2022-02-08 20:46
PR 31229 merged miss-islington, 2022-02-09 14:23
PR 31230 merged miss-islington, 2022-02-09 14:23
Messages (6)
msg412865 - (view) Author: Nikita Sobolev (sobolevn) * (Python triager) Date: 2022-02-08 20:03
New features (like `Self` type and `Never` type), in my opinion, require some extra testing.

Things that were not covered:
- Inheritance from `Self`, only `type(Self)` is covered: https://github.com/python/cpython/blob/c018d3037b5b62e6d48d5985d1a37b91762fbffb/Lib/test/test_typing.py#L193-L196
- Equality and non-equality for `Self` and `Never`. We should be sure that `NoReturn` is not equal to `Never`, but they are equal to themselfs
- `get_type_hints` with `Never`
- `get_origin` with `Self` and `Never` types, it should return `None` for both cases
- (not exactly related) I've also noticed that this line is not covered at all: https://github.com/python/cpython/blob/c018d3037b5b62e6d48d5985d1a37b91762fbffb/Lib/typing.py#L725

Maybe there are some other cases? 

I will send a PR :)
msg412866 - (view) Author: Jelle Zijlstra (JelleZijlstra) * (Python committer) Date: 2022-02-08 20:05
Thanks for catching these details! Please send a PR.
msg412907 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2022-02-09 14:23
New changeset d2d1d49eaccaa83eb8873ba15f2fc9562143bc56 by Nikita Sobolev in branch 'main':
bpo-46685: cover `TypeError` of `ForwardRef(1)` in `test_typing` (GH-31223)
https://github.com/python/cpython/commit/d2d1d49eaccaa83eb8873ba15f2fc9562143bc56
msg412912 - (view) Author: miss-islington (miss-islington) Date: 2022-02-09 15:12
New changeset d29bbc22b08551afce24e933f43bfcb6e980cb08 by Miss Islington (bot) in branch '3.10':
bpo-46685: cover `TypeError` of `ForwardRef(1)` in `test_typing` (GH-31223)
https://github.com/python/cpython/commit/d29bbc22b08551afce24e933f43bfcb6e980cb08
msg412913 - (view) Author: miss-islington (miss-islington) Date: 2022-02-09 15:12
New changeset bde3765a3fd21e2ecf595a57998b285e3045f744 by Miss Islington (bot) in branch '3.9':
bpo-46685: cover `TypeError` of `ForwardRef(1)` in `test_typing` (GH-31223)
https://github.com/python/cpython/commit/bde3765a3fd21e2ecf595a57998b285e3045f744
msg413526 - (view) Author: Jelle Zijlstra (JelleZijlstra) * (Python committer) Date: 2022-02-19 01:56
New changeset 32e3e0bea613711a8f19003445eebcb05fb75acc by Nikita Sobolev in branch 'main':
bpo-46685: improve test coverage of `Self` and `Never` in `typing` (GH-31222)
https://github.com/python/cpython/commit/32e3e0bea613711a8f19003445eebcb05fb75acc
History
Date User Action Args
2022-04-11 14:59:55adminsetgithub: 90843
2022-02-19 01:57:22JelleZijlstrasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2022-02-19 01:56:34JelleZijlstrasetmessages: + msg413526
2022-02-09 15:12:36miss-islingtonsetmessages: + msg412913
2022-02-09 15:12:30miss-islingtonsetmessages: + msg412912
2022-02-09 14:23:31miss-islingtonsetpull_requests: + pull_request29400
2022-02-09 14:23:27miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request29399
2022-02-09 14:23:20corona10setnosy: + corona10
messages: + msg412907
2022-02-08 20:46:51sobolevnsetpull_requests: + pull_request29394
2022-02-08 20:05:08JelleZijlstrasetmessages: + msg412866
2022-02-08 20:04:36sobolevnsetkeywords: + patch
stage: patch review
pull_requests: + pull_request29392
2022-02-08 20:03:46sobolevncreate