Issue #501: Make test generators importable in other modules

Building a test factory using test generators won't work if the factory itself is imported and used in other modules.

This issue is fully described in the issue #501.

I saw there's no test explicitly covering the part which decorates the test case using `transplant_func`. Is it worth adding such a test?