tests/jsonpickle_test: use pytest for standalone execution
# Copyright (C) 2008 John Paulett (john -at- paulett.org)
-# Copyright (C) 2009-2018 David Aguilar (davvid -at- gmail.com)
+# Copyright (C) 2009-2021 David Aguilar (davvid -at- gmail.com)
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
from __future__ import absolute_import, division, unicode_literals
-import doctest
import os
import unittest
import collections
+import pytest
+
import jsonpickle
import jsonpickle.backend
import jsonpickle.handlers
-
from jsonpickle import compat, tags, util
from jsonpickle.compat import PY2, PY3
-
from helper import SkippableTest
@@ -1555,17 +1554,5 @@ def test_repeat_objects_are_expanded():
assert flattened['passengers'][0]['child']['name'] == 'bob'
-def suite():
- suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(JSONPickleTestCase))
- suite.addTest(unittest.makeSuite(PicklingTestCase))
- suite.addTest(unittest.makeSuite(PicklingProtocol2TestCase))
- suite.addTest(unittest.makeSuite(PicklingProtocol4TestCase))
- suite.addTest(doctest.DocTestSuite(jsonpickle))
- suite.addTest(doctest.DocTestSuite(jsonpickle.pickler))
- suite.addTest(doctest.DocTestSuite(jsonpickle.unpickler))
- return suite
-
-
if __name__ == '__main__':
- unittest.main(defaultTest='suite')
+ pytest.main([__file__])
