mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
bpo-45229: Make pickle tests discoverable (GH-28467)
This commit is contained in:
parent
f71300cb04
commit
e6ba992288
3 changed files with 36 additions and 47 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue