generated from jCloud/repository-template
style: limit line length to 79 characters
Limited the lengths of all lines to 79 characters (if possible). Additionally, some other lines were breaked for consistence.
This commit is contained in:
25 files changed
+6726
-1071
No files matched your search
@@ -31,13 +31,37 @@ def test_assert_that_is_instance(obj, class_or_tuple):
|
||||
assert_that_is_instance(obj, class_or_tuple)
|
||||
|
||||
@pytest.mark.parametrize('obj,class_or_tuple,expected_exception_msg', [
|
||||
(1, str, 'expected \'str\', got \'int\''),
|
||||
(1, (str,), 'expected \'str\', got \'int\''),
|
||||
(1, str | float, 'expected either \'str\' or \'float\', got \'int\''),
|
||||
(1, str | float | list, 'expected either \'str\', \'float\' or \'list\', got \'int\''),
|
||||
(1, TestType, 'expected \'NOT TestType\', got \'int\''),
|
||||
(
|
||||
1,
|
||||
str,
|
||||
'expected \'str\', got \'int\''
|
||||
),
|
||||
(
|
||||
1,
|
||||
(str,),
|
||||
'expected \'str\', got \'int\''
|
||||
),
|
||||
(
|
||||
1,
|
||||
str | float,
|
||||
'expected either \'str\' or \'float\', got \'int\''
|
||||
),
|
||||
(
|
||||
1,
|
||||
str | float | list,
|
||||
'expected either \'str\', \'float\' or \'list\', got \'int\''
|
||||
),
|
||||
(
|
||||
1,
|
||||
TestType,
|
||||
'expected \'NOT TestType\', got \'int\''
|
||||
),
|
||||
])
|
||||
def test_assert_that_is_instance_exceptions(obj, class_or_tuple, expected_exception_msg):
|
||||
def test_assert_that_is_instance_exceptions(
|
||||
obj,
|
||||
class_or_tuple,
|
||||
expected_exception_msg
|
||||
):
|
||||
with pytest.raises(TypeError) as exc_info:
|
||||
assert_that_is_instance(obj, class_or_tuple)
|
||||
assert str(exc_info.value) == expected_exception_msg
|
||||
@@ -48,7 +48,12 @@ import pytest
|
||||
([1, 2, 3], 'and', '\'', '\'1\', \'2\' and \'3\''),
|
||||
([1, 2, 3], '', '\'', '\'1\', \'2\' \'3\''),
|
||||
([1, 2, 3, 42, 'a', 23], 'and', '', '1, 2, 3, 42, a and 23'),
|
||||
([1, 2, 3, 42, 'a', 23], 'and', '\'', '\'1\', \'2\', \'3\', \'42\', \'a\' and \'23\''),
|
||||
(
|
||||
[1, 2, 3, 42, 'a', 23],
|
||||
'and',
|
||||
'\'',
|
||||
'\'1\', \'2\', \'3\', \'42\', \'a\' and \'23\''
|
||||
),
|
||||
])
|
||||
def test_human_readable_list(ls, final_separator, quotation_mark, expected):
|
||||
assert human_readable_list(ls, final_separator, quotation_mark) == expected
|
||||
Reference in new issue
Block a user