Пример #1
0
def test_assert_not_none_bad():
    with asserts.expect_exception(AssertionError):
        asserts.is_not_none(None)
Пример #2
0
def test_assert_same_bad(x, y):
    with asserts.expect_exception(AssertionError):
        asserts.are_same(x, y)
Пример #3
0
def test_assert_not_in_bad(item, collection):
    with asserts.expect_exception(AssertionError):
        asserts.is_not_in(item, collection)
Пример #4
0
def test_assert_not_empty_bad(collection):
    with asserts.expect_exception(AssertionError):
        asserts.is_not_empty(collection)
Пример #5
0
def test_test_call_not_implemented():
  t = Test('foo', 'bar.foo', 'foo bar test')
  with asserts.expect_exception(NotImplementedError):
    t()
Пример #6
0
def test_assert_not_equal_bad(x, y):
    with asserts.expect_exception(AssertionError):
        asserts.are_not_equal(x, y)
Пример #7
0
def test_assert_length_bad(collection):
    with asserts.expect_exception(AssertionError):
        asserts.has_length(collection, 1)
Пример #8
0
def test_test_call_not_implemented():
    t = Test('foo', 'bar.foo', 'foo bar test')
    with asserts.expect_exception(NotImplementedError):
        t()
Пример #9
0
def test_assert_same_bad(x, y):
    with asserts.expect_exception(AssertionError):
        asserts.are_same(x, y)
Пример #10
0
def test_assert_not_same_bad(value):
    with asserts.expect_exception(AssertionError):
        asserts.are_not_same(value, value)
Пример #11
0
def test_assert_not_none_bad():
    with asserts.expect_exception(AssertionError):
        asserts.is_not_none(None)
Пример #12
0
def test_assert_not_empty_bad(collection):
    with asserts.expect_exception(AssertionError):
        asserts.is_not_empty(collection)
Пример #13
0
def test_assert_not_in_bad(item, collection):
    with asserts.expect_exception(AssertionError):
        asserts.is_not_in(item, collection)
Пример #14
0
def test_assert_not_same_bad(value):
    with asserts.expect_exception(AssertionError):
        asserts.are_not_same(value, value)
Пример #15
0
def test_is_false_fail(value):
    with asserts.expect_exception(AssertionError):
        asserts.is_false(value)
Пример #16
0
def test_assert_length_bad(collection):
    with asserts.expect_exception(AssertionError):
        asserts.has_length(collection, 1)
Пример #17
0
def test_is_false_fail(value):
    with asserts.expect_exception(AssertionError):
        asserts.is_false(value)
Пример #18
0
def test_test_required_variables_not_implemented():
    t = Test('foo', 'bar.foo', 'foo bar test')
    with asserts.expect_exception(NotImplementedError):
        t.required_variables()
Пример #19
0
def test_assert_not_equal_bad(x, y):
    with asserts.expect_exception(AssertionError):
        asserts.are_not_equal(x, y)
Пример #20
0
def test_test_required_variables_not_implemented():
  t = Test('foo', 'bar.foo', 'foo bar test')
  with asserts.expect_exception(NotImplementedError):
    t.required_variables()
Пример #21
0
def test_divide_2_0():
  with asserts.expect_exception(ZeroDivisionError):
    2 / 0