예제 #1
0
def test_pushd_with_exception():
    cwd = os.getcwd()
    try:
        with pushd('tests'):
            raise Exception('testing...')
    except Exception:
        pass
    assert cwd == os.getcwd()
예제 #2
0
def test_pushd():
    cwd = os.getcwd()
    with pushd('tests'):
        assert os.getcwd() == cwd + '/' + 'tests'
    assert cwd == os.getcwd()