Kaydet (Commit) 90bbbd11 authored tarafından Ezio Melotti's avatar Ezio Melotti

#16919: test_crypt now works with unittest test discovery. Patch by Zachary Ware.

üst d394455a
from test import support from test import support
import unittest import unittest
crypt = support.import_module('crypt') def setUpModule():
# this import will raise unittest.SkipTest if _crypt doesn't exist,
# so it has to be done in setUpModule for test discovery to work
global crypt
crypt = support.import_module('crypt')
class CryptTestCase(unittest.TestCase): class CryptTestCase(unittest.TestCase):
...@@ -29,8 +33,5 @@ class CryptTestCase(unittest.TestCase): ...@@ -29,8 +33,5 @@ class CryptTestCase(unittest.TestCase):
self.assertTrue(len(crypt.methods) >= 1) self.assertTrue(len(crypt.methods) >= 1)
self.assertEqual(crypt.METHOD_CRYPT, crypt.methods[-1]) self.assertEqual(crypt.METHOD_CRYPT, crypt.methods[-1])
def test_main():
support.run_unittest(CryptTestCase)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()
...@@ -421,6 +421,9 @@ Library ...@@ -421,6 +421,9 @@ Library
Tests Tests
----- -----
- Issue #16919: test_crypt now works with unittest test discovery.
Patch by Zachary Ware.
- Issue #16910: test_bytes, test_unicode, and test_userstring now work with - Issue #16910: test_bytes, test_unicode, and test_userstring now work with
unittest test discovery. Patch by Zachary Ware. unittest test discovery. Patch by Zachary Ware.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment