Skip to content

Commit

Permalink
Merge pull request #186 from PeterJCLaw/use-builtin-unittest
Browse files Browse the repository at this point in the history
Support Python 3.10
  • Loading branch information
dannyroberts authored Mar 14, 2022
2 parents 19db996 + eac15ea commit 347769e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9"]
python-version: ["3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
packages=['jsonobject'],
setup_requires=CYTHON_REQUIRES,
install_requires=['six'],
tests_require=['unittest2'],
ext_modules=extensions,
test_suite='test',
classifiers=(
Expand All @@ -62,6 +61,7 @@
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'License :: OSI Approved :: BSD License',
),
)
2 changes: 1 addition & 1 deletion test/test_couchdbkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from __future__ import unicode_literals
import json
import os
from unittest2 import TestCase
from unittest import TestCase
from .couchdbkit.application import Application
from io import open

Expand Down
4 changes: 2 additions & 2 deletions test/test_stringconversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import datetime
from jsonobject.exceptions import BadValueError
from jsonobject import JsonObject, ObjectProperty, DateTimeProperty
import unittest2
import unittest
from jsonobject.base import get_settings


class StringConversionsTest(unittest2.TestCase):
class StringConversionsTest(unittest.TestCase):

EXAMPLES = {
'decimal': '1.2',
Expand Down
20 changes: 10 additions & 10 deletions test/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from __future__ import unicode_literals
import six
from copy import deepcopy
import unittest2
import unittest
from jsonobject import *
from jsonobject.exceptions import (
BadValueError,
Expand Down Expand Up @@ -68,7 +68,7 @@ class ObjectWithDictProperty(JsonObject):
mapping = DictProperty()


class JsonObjectTestCase(unittest2.TestCase):
class JsonObjectTestCase(unittest.TestCase):
def _danny_data(self):
return {
'first_name': 'Danny',
Expand Down Expand Up @@ -434,7 +434,7 @@ class Foo(JsonObject):
self.assertIsInstance(foo.bar, Bar)


class PropertyInsideContainerTest(unittest2.TestCase):
class PropertyInsideContainerTest(unittest.TestCase):

def test_default_is_required(self):
class Foo(JsonObject):
Expand Down Expand Up @@ -466,7 +466,7 @@ class Foo(JsonObject):
Foo(container=[None])


class LazyValidationTest(unittest2.TestCase):
class LazyValidationTest(unittest.TestCase):

def _validate_raises(self, foo):
with self.assertRaises(BadValueError):
Expand Down Expand Up @@ -577,7 +577,7 @@ class Foo(JsonObject):
self._validate_not_raises(foo)


class PropertyTestCase(unittest2.TestCase):
class PropertyTestCase(unittest.TestCase):
def test_date(self):
import datetime
p = DateProperty()
Expand Down Expand Up @@ -755,12 +755,12 @@ def test_attribute_error(self):
class Foo(JsonObject):
pass
foo = Foo()

with self.assertRaises(AttributeError):
foo.hello


class DynamicConversionTestCase(unittest2.TestCase):
class DynamicConversionTestCase(unittest.TestCase):
import datetime

class Foo(JsonObject):
Expand Down Expand Up @@ -843,7 +843,7 @@ class User(JsonObject):
tags = ListProperty(six.text_type)


class TestExactDateTime(unittest2.TestCase):
class TestExactDateTime(unittest.TestCase):
def test_exact(self):
class DateObj(JsonObject):
date = DateTimeProperty(exact=True)
Expand All @@ -862,7 +862,7 @@ class DateObj(JsonObject):
self.assertEqual(len(date_obj.to_json()['date']), 27)


class IntegerTest(unittest2.TestCase):
class IntegerTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
class Foo(JsonObject):
Expand All @@ -883,7 +883,7 @@ def test_set_zero(self):
self.assertEqual(foo.to_json()['my_int'], 0)


class TestReadmeExamples(unittest2.TestCase):
class TestReadmeExamples(unittest.TestCase):
def test(self):
import datetime
user1 = User(
Expand Down

0 comments on commit 347769e

Please sign in to comment.