[issue38155] Add __all__ to the datetime module

Tahia K report at bugs.python.org
Sat Sep 14 20:33:48 EDT 2019


Tahia K <tahia.khan at gmail.com> added the comment:

I'll definitely add that test @Paul. 

Speaking of, what do you guys think of this test:

     def test_c_all(self):
         """Test that __all__ symbols between the c datetime module and
         the python datetime library are equivalent."""

         c_datetime = import_fresh_module('datetime', fresh=['_datetime'])
         py_datetime = import_fresh_module('datetime', blocked=['_datetime'])
         self.assertEqual(c_datetime.__all__, py_datetime.__all__)


I found the import_fresh_module here: https://docs.python.org/3/library/test.html#test.support.import_fresh_module - super handy! The test currently passes for me locally, but I wanted to check if my usage was correct before submitting a PR.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38155>
_______________________________________


More information about the Python-bugs-list mailing list