| 1 | ``is_method`` / ``_test_from_is_method``: method wrappers to factor out code between ``is_bar`` and ``_test_bar`` methods |

| 2 | |

| 3 | From the documentation: |

| 4 | |

| 5 | The typical usecase for those wrappers is as follow: Consider a |

| 6 | category ``Foo`` with a subcategory ``Bar``. ``Foo`` wants to |

| 7 | provide a method ``Foo.ParentMethods.is_bar`` such that, for ``F`` |

| 8 | in ``Foo()``, ``F.is_bar()`` returns whether ``F`` satisfies all |

| 9 | the properties of ``Bar()``. The method ``is_bar`` is allowed to |

| 10 | assume that ``F`` indeed satisfies all the properties specified by |

| 11 | ``Foo()``. It may decide to upgrade the category of ``F`` to |

| 12 | ``Bar()``. |

| 13 | |

| 14 | ``Bar`` itself wants to provide a method |

| 15 | ``Bar.ParentMethod._test_bar`` which is supposed to do some |

| 16 | reasonable sanity checks on ``F`` to determine whether it |

| 17 | satisfies all the properties of ``Bar``. If yes, ``F._test_bla()`` |

| 18 | should return None; otherwise it should raise some (hopefully |

| 19 | meaningful) assertion. Note that ``Bar()`` will typically |

| 20 | override ``is_bar`` by a trivial method that always returns |

| 21 | ``True``. |

| 22 | |

| 23 | The purpose of two decorators ``is_method`` and |

| 24 | ``_test_method_from_is`` is to factor out the logic between the two |

| 25 | related methods ``F.is_bla()`` and ``F._test_bla()``. They take as |

| 26 | input a Python function ``is_bla(self, proof=False, **options)``. |

| 27 | This function should proceed as usual for a ``_test method`` (see |

| 28 | :class:`TestSuite`). If ``proof`` is ``True``, then the answer |

| 29 | should be provably correct. At the end, ``is_bla`` should return |

| 30 | ``None``, or a category that will be used to refine the category |

| 31 | of ``F``. |