def test_cd_home_dir():
 homepath = '~/somepath'
 with cd(homepath):
  eq_(env.cwd, homepath)

def test_cd_home_dir ( ) : homepath = '~/somepath' with cd ( homepath ) : eq_ ( env . cwd , homepath )
cd() should work with home directories .