def testRunNotebooks(self):
        notebook_dir = path.join('tests', 'input')
        for notebook_path in glob(path.join(notebook_dir, '*.ipynb')):
            notebook_file = path.basename(notebook_path)
            print(notebook_file)
            expected_file = path.join('tests', 'expected', notebook_file)
            notebook = ""
            with open(notebook_path) as notebook_file:
                notebook = notebook_file.read()
            try:
                # IPython 3
                notebook = reads(notebook, 3)
            except (TypeError, NBFormatError):
                # IPython 2
                notebook = reads(notebook, 'json')
            runner = NotebookRunner(notebook, working_dir=notebook_dir)
            runner.run_notebook(True)
            expected = ""
            with open(expected_file) as notebook_file:
                expected = notebook_file.read()
            try:
                # IPython 3
                expected = reads(expected, 3)
            except (__HOLE__, NBFormatError):
                # IPython 2
                expected = reads(expected, 'json')
            self.assert_notebooks_equal(expected, runner.nb)
dataset/ETHPy150Open paulgb/runipy/test_runipy.py/TestRunipy.testRunNotebooks