summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_http_cookies.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2021-09-20 08:36:57 (GMT)
committerGitHub <noreply@github.com>2021-09-20 08:36:57 (GMT)
commita856364cc920d8b16750fd1fadc902efb509754c (patch)
tree1f5f618d8ad0e18fd8718bc8cfaf478cd26280be /Lib/test/test_http_cookies.py
parent5e2c32e08ed77081cabd9d51f0589f81c1572732 (diff)
downloadcpython-a856364cc920d8b16750fd1fadc902efb509754c.zip
cpython-a856364cc920d8b16750fd1fadc902efb509754c.tar.gz
cpython-a856364cc920d8b16750fd1fadc902efb509754c.tar.bz2
bpo-45229: Use doctest.DocTestSuite instead of run_doctest (GH-28468)
Alo use load_tests() for adding tests.
Diffstat (limited to 'Lib/test/test_http_cookies.py')
-rw-r--r--Lib/test/test_http_cookies.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/Lib/test/test_http_cookies.py b/Lib/test/test_http_cookies.py
index 6072c7e..925c869 100644
--- a/Lib/test/test_http_cookies.py
+++ b/Lib/test/test_http_cookies.py
@@ -1,8 +1,8 @@
# Simple test suite for http/cookies.py
import copy
-from test.support import run_unittest, run_doctest
import unittest
+import doctest
from http import cookies
import pickle
@@ -479,9 +479,11 @@ class MorselTests(unittest.TestCase):
r'Set-Cookie: key=coded_val; '
r'expires=\w+, \d+ \w+ \d+ \d+:\d+:\d+ \w+')
-def test_main():
- run_unittest(CookieTests, MorselTests)
- run_doctest(cookies)
+
+def load_tests(loader, tests, pattern):
+ tests.addTest(doctest.DocTestSuite(cookies))
+ return tests
+
if __name__ == '__main__':
- test_main()
+ unittest.main()