def test_handle_default_args(self): """ Assert that the --pythonpath argument changes sys.path """ parser = argparse.ArgumentParser(parents=[DefaultParser()]) args = parser.parse_args(['--traceback', '--pythonpath', '/tmp/lib/mypy']) # Handle the default arguments handle_default_args(args) # Ensure that the path is modified. self.assertIn('/tmp/lib/mypy', sys.path)
def test_handle_default_args(self): """ Assert that the --pythonpath argument changes sys.path """ parser = argparse.ArgumentParser(parents=[DefaultParser()]) args = parser.parse_args( ['--traceback', '--pythonpath', '/tmp/lib/mypy']) # Handle the default arguments handle_default_args(args) # Ensure that the path is modified. self.assertIn('/tmp/lib/mypy', sys.path)
def test_no_path_modification(self): """ Ensure that sys.path remains unchanged after defaults. """ parser = argparse.ArgumentParser(parents=[DefaultParser()]) args = parser.parse_args([]) oldpath = list(sys.path) # Handle the default arguments handle_default_args(args) # Ensure that the path is unmodified. self.assertEqual(oldpath, sys.path)