Exemplo n.º 1
0
def test_trash_long_folder():
    path = create_tree()
    try:
        trash(str(path))
        assert not path.exists()
    except PermissionError:
        pytest.skip("Cannot trash from different partition.")
    finally:
        with suppress(OSError):
            path.parent.unlink()
Exemplo n.º 2
0
def test_trash_long_folder():
    path = create_tree()
    parent = os.path.dirname(path)
    try:
        trash(path)
        assert not os.path.exists(path)
    except PermissionError:
        pytest.skip("Cannot trash from different partition.")
    finally:
        with suppress(OSError):
            os.remove(parent)
Exemplo n.º 3
0
def delete_files():  # Send screenshots to Trash/Recycle Bin after merge
    for i in range(0, 3):
        print('File "{}" successfully moved to Trash!'.format(files[i]))
        trash(screenshot_folder + files[i])