Skip to content

Conversation

@youknowone
Copy link
Contributor

@youknowone youknowone commented Jan 18, 2026

The _datetime dependency of test_sys is only required for @cpython_only decorated test.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

self.assertEqual(sys.getsizeof(True, -1), size('') + self.longdigit)

def test_objecttypes(self):
import _datetime
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to import it just before it is used, like collections.

And since it is optional, skip the corresponding test if the import fails.

@serhiy-storchaka serhiy-storchaka added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting merge needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants