bpo-38155: Add __all__ to datetime module (GH-16203)
https://bugs.python.org/issue38155
diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py
index 32977b1..42e2cec 100644
--- a/Lib/test/datetimetester.py
+++ b/Lib/test/datetimetester.py
@@ -62,6 +62,12 @@
self.assertEqual(datetime.MINYEAR, 1)
self.assertEqual(datetime.MAXYEAR, 9999)
+ def test_all(self):
+ """Test that __all__ only points to valid attributes."""
+ all_attrs = dir(datetime_module)
+ for attr in datetime_module.__all__:
+ self.assertIn(attr, all_attrs)
+
def test_name_cleanup(self):
if '_Pure' in self.__class__.__name__:
self.skipTest('Only run for Fast C implementation')