-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
bpo-40331: Increase test coverage for the statistics module #19608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
ccd8bef
21084c1
49def61
b2b9844
50a843f
bbe16bd
74b047a
1a5c2df
ac8b586
ee55b16
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1525,6 +1525,16 @@ def test_single_value_unsupported_type(self): | |
| with self.assertRaisesRegex(TypeError, '^unsupported type$'): | ||
| self.func(['3.14']) | ||
|
|
||
| def test_multiple_values_type_error(self): | ||
|
||
| # Test TypeError is raised when given multiple (valid/invalid) values | ||
| for data in [ | ||
| ['1', '2', '3'], # only strings | ||
| [1, '2', 3, '4', 5], # mixed strings and valid integers | ||
| [2.3, 3.4, 4.5, '5.6'] # only one string and valid floats | ||
| ]: | ||
| with self.assertRaises(TypeError): | ||
| self.func(data) | ||
|
|
||
| def test_ints(self): | ||
| # Test harmonic mean with ints. | ||
| data = [2, 4, 4, 8, 16, 16] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the value of this regex here: Would it be wrong if we changed the error message in the future? I prefer that we just check that a
TypeErroris raised.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.