Add test that transplants a function generator

Currently failing due to #501. When the test is transplanted it is wrapped in another function, which means that `isgeneratorfunction()` returns `False`. There is already a fix for this in #620.