def is_venv(self, new_dir, old_dir): """ useful as a post-hook for "cd" commands. it might be a good idea to call this after the "jump" command or after "pushd" as well, but that's not implemented. """ if self.announce_on_cd and is_venv(new_dir): self.report('directory is a python virtualenv.') self.report('use `venv_activate .` to activate it')
def test_is_venv(self): self.assertTrue(venv.is_venv(self.venv1))