Exemple #1
0
 def testRunPytypeGenerateBuiltins(self):
     """Basic smoke test for --generate-builtins."""
     filename = self._TmpPath("builtins")
     argv = ["--generate-builtins", filename]
     options = config.Options(argv)
     main_module._run_pytype(options)
     self.assertTrue(os.path.isfile(filename))
Exemple #2
0
 def testRunPytype(self):
     """Basic smoke test for _run_pytype."""
     infile = self._TmpPath("input")
     outfile = self._TmpPath("output")
     with open(infile, "w") as f:
         f.write("def f(x): pass")
     argv = ["", "-o", outfile, infile]
     options = config.Options(argv)
     main_module._run_pytype(options)
     self.assertTrue(os.path.isfile(outfile))
Exemple #3
0
 def testRunPytype(self):
     """Basic unit test (smoke test) for _run_pytype."""
     # TODO(kramm): This is a unit test, whereas all other tests in this file
     # are integration tests. Move this somewhere else?
     infile = self._TmpPath("input")
     outfile = self._TmpPath("output")
     with open(infile, "w") as f:
         f.write("def f(x): pass")
     options = config.Options.create(infile, output=outfile)
     main_module._run_pytype(options)
     self.assertTrue(os.path.isfile(outfile))