◐ Shell
reader mode source ↗

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: `'thread_time'` is missing from `test_get_clock_info`
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: gvanrossum, miss-islington, sobolevn
Priority: normal Keywords: patch

Created on 2022-01-26 09:02 by sobolevn, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 30913 merged sobolevn, 2022-01-26 09:03
PR 30977 merged miss-islington, 2022-01-28 06:03
PR 30978 merged miss-islington, 2022-01-28 06:03
Messages (5)
msg411717 - (view) Author: Nikita Sobolev (sobolevn) * (Python triager) Date: 2022-01-26 09:02
Right now here's how `test_get_clock_info` looks like:

```
def test_get_clock_info(self):
        clocks = ['monotonic', 'perf_counter', 'process_time', 'time']

        for name in clocks:
            info = time.get_clock_info(name)

            #self.assertIsInstance(info, dict)
            self.assertIsInstance(info.implementation, str)
            self.assertNotEqual(info.implementation, '')
            self.assertIsInstance(info.monotonic, bool)
            self.assertIsInstance(info.resolution, float)
            # 0.0 < resolution <= 1.0
            self.assertGreater(info.resolution, 0.0)
            self.assertLessEqual(info.resolution, 1.0)
            self.assertIsInstance(info.adjustable, bool)
```

It tests for out of five possible arguments to `time.get_clock_info`.
Docs: https://docs.python.org/3/library/time.html#time.get_clock_info
`'thread_time'` is missing for some reason.

I think we should add it to the test.

Link: https://github.com/python/cpython/blob/7cf285d82ec722d4225297366013e924805171f2/Lib/test/test_time.py#L559

PR is incoming.
msg411976 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2022-01-28 05:43
New changeset c27a33132be101e246ae2584f1826477357138d6 by Nikita Sobolev in branch 'main':
bpo-46530: add `"thread_time"` to `test_time.test_get_clock_info` (#30913)
https://github.com/python/cpython/commit/c27a33132be101e246ae2584f1826477357138d6
msg411977 - (view) Author: Nikita Sobolev (sobolevn) * (Python triager) Date: 2022-01-28 06:00
Thank you!
msg412013 - (view) Author: miss-islington (miss-islington) Date: 2022-01-28 16:56
New changeset ce5c637f5ae06f2a6a6e966524af9d0cc816bd3f by Miss Islington (bot) in branch '3.9':
bpo-46530: add `"thread_time"` to `test_time.test_get_clock_info` (GH-30913)
https://github.com/python/cpython/commit/ce5c637f5ae06f2a6a6e966524af9d0cc816bd3f
msg412014 - (view) Author: miss-islington (miss-islington) Date: 2022-01-28 16:56
New changeset 95b70e2ccfb295c77c3696bcb20c1513310efd1f by Miss Islington (bot) in branch '3.10':
bpo-46530: add `"thread_time"` to `test_time.test_get_clock_info` (GH-30913)
https://github.com/python/cpython/commit/95b70e2ccfb295c77c3696bcb20c1513310efd1f
History
Date User Action Args
2022-04-11 14:59:55adminsetgithub: 90688
2022-01-28 16:56:57miss-islingtonsetmessages: + msg412014
2022-01-28 16:56:36miss-islingtonsetmessages: + msg412013
2022-01-28 06:03:39miss-islingtonsetpull_requests: + pull_request29157
2022-01-28 06:03:34miss-islingtonsetnosy: + miss-islington

pull_requests: + pull_request29156
2022-01-28 06:00:55sobolevnsetstatus: open -> closed
resolution: fixed
messages: + msg411977

stage: patch review -> resolved
2022-01-28 05:43:03gvanrossumsetnosy: + gvanrossum
messages: + msg411976
2022-01-26 09:03:56sobolevnsetkeywords: + patch
stage: patch review
pull_requests: + pull_request29092
2022-01-26 09:02:03sobolevncreate