bpo-45229: Make pickle tests discoverable (GH-28467)

This commit is contained in:
Serhiy Storchaka 2021-09-20 18:21:33 +03:00 committed by GitHub
parent f71300cb04
commit e6ba992288
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 47 deletions

View file

@ -2,9 +2,10 @@ import pickle
import pickletools
from test import support
from test.pickletester import AbstractPickleTests
import doctest
import unittest
class OptimizedPickleTests(AbstractPickleTests):
class OptimizedPickleTests(AbstractPickleTests, unittest.TestCase):
def dumps(self, arg, proto=None, **kwargs):
return pickletools.optimize(pickle.dumps(arg, proto, **kwargs))
@ -94,11 +95,10 @@ class MiscTestCase(unittest.TestCase):
support.check__all__(self, pickletools, not_exported=not_exported)
def test_main():
support.run_unittest(OptimizedPickleTests)
support.run_unittest(MiscTestCase)
support.run_doctest(pickletools)
def load_tests(loader, tests, pattern):
tests.addTest(doctest.DocTestSuite(pickletools))
return tests
if __name__ == "__main__":
test_main()
unittest.main()