[Python-checkins] cpython: Issue27139 patch by Julio C Cardoza.
steven.daprano
python-checkins at python.org
Thu Jul 7 12:52:29 EDT 2016
https://hg.python.org/cpython/rev/4c4f8b0c5b30
changeset: 102283:4c4f8b0c5b30
parent: 102281:c80054ccbbd8
user: Steven D'Aprano <steve at pearwood.info>
date: Fri Jul 08 02:38:45 2016 +1000
summary:
Issue27139 patch by Julio C Cardoza.
files:
Lib/test/test_statistics.py | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/Lib/test/test_statistics.py b/Lib/test/test_statistics.py
--- a/Lib/test/test_statistics.py
+++ b/Lib/test/test_statistics.py
@@ -1600,6 +1600,22 @@
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.
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list