[7.x] Apply Black 20.8b1 formatting

This commit is contained in:
Seth Michael Larson
2020-08-27 10:52:30 -05:00
committed by Seth Michael Larson
parent 8ab07f44b8
commit e893facb97
5 changed files with 19 additions and 8 deletions
+3 -1
View File
@@ -534,7 +534,9 @@ class TestRequestsConnection(TestCase):
self.assertNotIn("accept-encoding", req.headers)
def test_http_compression(self):
con = self._get_mock_connection({"http_compress": True},)
con = self._get_mock_connection(
{"http_compress": True},
)
self.assertTrue(con.http_compress)
+8 -4
View File
@@ -108,7 +108,8 @@ class TestJSONSerializer(TestCase):
def test_serializes_numpy_nan_to_nan(self):
self.assertEqual(
'{"d":NaN}', JSONSerializer().dumps({"d": np.nan}),
'{"d":NaN}',
JSONSerializer().dumps({"d": np.nan}),
)
def test_serializes_pandas_timestamp(self):
@@ -127,7 +128,8 @@ class TestJSONSerializer(TestCase):
if not hasattr(pd, "NA"): # pandas.NA added in v1
raise SkipTest("pandas.NA required")
self.assertEqual(
'{"d":null}', JSONSerializer().dumps({"d": pd.NA}),
'{"d":null}',
JSONSerializer().dumps({"d": pd.NA}),
)
def test_raises_serialization_error_pandas_nat(self):
@@ -138,12 +140,14 @@ class TestJSONSerializer(TestCase):
def test_serializes_pandas_category(self):
cat = pd.Categorical(["a", "c", "b", "a"], categories=["a", "b", "c"])
self.assertEqual(
'{"d":["a","c","b","a"]}', JSONSerializer().dumps({"d": cat}),
'{"d":["a","c","b","a"]}',
JSONSerializer().dumps({"d": cat}),
)
cat = pd.Categorical([1, 2, 3], categories=[1, 2, 3])
self.assertEqual(
'{"d":[1,2,3]}', JSONSerializer().dumps({"d": cat}),
'{"d":[1,2,3]}',
JSONSerializer().dumps({"d": cat}),
)
def test_raises_serialization_error_on_dump_error(self):