Esempio n. 1
0
def test_fn_ends_with_pass():
    def useless_fn():
        pass

    def usefull_fn():
        print("I am useful!")

    assert utils.fn_ends_with_pass(useless_fn) is True
    assert utils.fn_ends_with_pass(usefull_fn) is False
Esempio n. 2
0
def test_fn_ends_with_pass():
    """@TODO: Docs. Contribution is welcome."""
    def useless_fn():
        pass

    def usefull_fn():
        print("I am useful!")

    assert utils.fn_ends_with_pass(useless_fn) is True
    assert utils.fn_ends_with_pass(usefull_fn) is False
Esempio n. 3
0
 def test_fn_ends_with_pass_on_callback(
     callback,
     events,
 ):
     for event in events["covered"]:
         fn_name = f"on_{event}"
         assert (utils.fn_ends_with_pass(
             getattr(callback.__class__, fn_name)) is False)
     for event in events["non-covered"]:
         fn_name = f"on_{event}"
         assert (utils.fn_ends_with_pass(
             getattr(callback.__class__, fn_name)) is True)