def test_non_pythonpath_dep(self): conf = self.parser.config_from_defaults() d = self.normalize('foo/') conf.pythonpath = [d] dep = file_utils.expand_path('bar/baz.py') runner = pytype_runner.PytypeRunner([], [[dep]], conf) self.assert_sorted_modules_equal(runner.yield_sorted_modules(), [])
def make_converters(cwd=None): """For items that need coaxing into their internal representations.""" return { 'exclude': lambda v: file_utils.expand_source_files(v, cwd), 'inputs': lambda v: file_utils.expand_source_files(v, cwd), 'output': lambda v: file_utils.expand_path(v, cwd), 'pythonpath': lambda v: file_utils.expand_pythonpath(v, cwd), }
def make_converters(cwd=None): """For items that need coaxing into their internal representations.""" return { 'exclude': lambda v: file_utils.expand_source_files(v, cwd), 'keep_going': string_to_bool, 'inputs': lambda v: file_utils.expand_source_files(v, cwd), 'output': lambda v: file_utils.expand_path(v, cwd), 'python_version': get_python_version, 'pythonpath': lambda v: file_utils.expand_pythonpath(v, cwd), 'disable': concat_disabled_rules, }
def test_expand_with_cwd(self): with file_utils.Tempdir() as d: f = d.create_file("foo.py") self.assertEqual(file_utils.expand_path("foo.py", d.path), f)
def test_expand_one_path(self): full_path = os.path.join(os.getcwd(), "foo.py") self.assertEqual(file_utils.expand_path("foo.py"), full_path)
def normalize(self, d): return file_utils.expand_path(d).rstrip(os.sep) + os.sep