def test_chdir(self):
tmpdir = self.tmpdir.realpath()
old = local()
try:
-> res = tmpdir.chdir()
assert str(res) == str(old)
assert py.std.os.getcwd() == str(tmpdir)
finally:
old.chdir()