Python chainer.testing.run_module() Examples

The following are 1 code examples of chainer.testing.run_module(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module chainer.testing , or try the search function .
Example #1
Source File: test_runnable.py    From chainer with MIT License 5 votes vote down vote up
def test_runnable(self):
        cwd = os.path.dirname(__file__)
        regex = re.compile(r'^test_.*\.py$')
        for dirpath, dirnames, filenames in os.walk(cwd):
            for filename in filenames:
                if not regex.match(filename):
                    continue
                path = os.path.join(dirpath, filename)
                with io.open(path, encoding='utf-8') as f:
                    source = f.read()
                self.assertIn('testing.run_module(__name__, __file__)',
                              source,
                              '''{0} is not runnable.
Call testing.run_module at the end of the test.'''.format(path))