Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Lib/test/test_sys.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import builtins
import codecs
import _datetime
import gc
import io
import locale
Expand Down Expand Up @@ -1566,6 +1565,8 @@ def test_default(self):
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.


# check all types defined in Objects/
calcsize = struct.calcsize
size = test.support.calcobjsize
Expand Down
Loading