summaryrefslogtreecommitdiffstats
path: root/Lib/test/datetimetester.py
diff options
context:
space:
mode:
authort k <tahia.khan@gmail.com>2019-09-19 13:34:41 (GMT)
committerPaul Ganssle <paul@ganssle.io>2019-09-19 13:34:41 (GMT)
commit96b1c59c71534db3f0f3799cd84e2006923a5098 (patch)
tree58abb7680d3a72a0388cf643546f6c099af122a0 /Lib/test/datetimetester.py
parent9fdc64cf1266b6d5bf0503847b5c38e5edc53a14 (diff)
downloadcpython-96b1c59c71534db3f0f3799cd84e2006923a5098.zip
cpython-96b1c59c71534db3f0f3799cd84e2006923a5098.tar.gz
cpython-96b1c59c71534db3f0f3799cd84e2006923a5098.tar.bz2
bpo-38155: Add __all__ to datetime module (GH-16203)
https://bugs.python.org/issue38155
Diffstat (limited to 'Lib/test/datetimetester.py')
-rw-r--r--Lib/test/datetimetester.py6
1 files changed, 6 insertions, 0 deletions
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 @@ class TestModule(unittest.TestCase):
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')