Add test that transplants a function generator

Currently failing due to issue 501. When the test is transplanted it is
wrapped in another function, which means that
inspect.isgeneratorfunction() returns False. There is already a fix for
this in pull 620.
Merge pull request #758 from mjkillough/issue_501

Add test that transplants a function generator