示例#1
0
    def test_function_task_takes_name_from_callable(self):
        def my_fn():
            pass

        f = FunctionTask(fn=my_fn)
        assert f.name == "my_fn"
示例#2
0
    def test_function_task_takes_name_from_arg_if_provided(self):
        def my_fn():
            pass

        f = FunctionTask(fn=my_fn, name="test")
        assert f.name == "test"
示例#3
0
 def test_function_task_requires_callable(self):
     with pytest.raises(TypeError):
         FunctionTask(fn=1)