Kaydet (Commit) 8c115a46 authored tarafından Steven D'Aprano's avatar Steven D'Aprano

Issue27139 patch by Julio C Cardoza.

üst 2954f839
......@@ -1600,6 +1600,22 @@ class TestMedianGrouped(TestMedian):
data = [220, 220, 240, 260, 260, 260, 260, 280, 280, 300, 320, 340]
self.assertEqual(self.func(data, 20), 265.0)
def test_data_type_error(self):
# Test median_grouped with str, bytes data types for data and interval
data = ["", "", ""]
self.assertRaises(TypeError, self.func, data)
#---
data = [b"", b"", b""]
self.assertRaises(TypeError, self.func, data)
#---
data = [1, 2, 3]
interval = ""
self.assertRaises(TypeError, self.func, data, interval)
#---
data = [1, 2, 3]
interval = b""
self.assertRaises(TypeError, self.func, data, interval)
class TestMode(NumericTestCase, AverageMixin, UnivariateTypeMixin):
# Test cases for the discrete version of mode.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment