def test_get_cwd(tmpdir): assert cli.get_cwd() == os.getcwd() with tmpdir.as_cwd(): assert cli.get_cwd() == str(tmpdir) assert cli.get_cwd() == os.getcwd()