def test_clean_do_not_remove_hidden_files(): name = tmp_dir + "/" + ".toto.pyc" with open(name, 'w') as f: f.write("toto") clean(tmp_dir) assert exists(name)
def test_clean_do_not_remove_hidden_files(tmp_dir): name = tmp_dir + "/" + ".toto.pyc" with open(name, 'w') as f: f.write("toto") clean(tmp_dir) assert exists(name)
def test_clean_remove_pyc_files(tmp_dir): name = tmp_dir + "/" + "toto.pyc" with open(name, 'w') as f: f.write("toto") clean(tmp_dir) assert not exists(name)
def test_clean_remove_pyc_files(): name = tmp_dir + "/" + "toto.pyc" with open(name, 'w') as f: f.write("toto") clean(tmp_dir) assert not exists(name)
def test_clean_remove_dist_build_directories(tmp_dir): for name in ("dist", "build"): ensure_created(tmp_dir / name) clean(tmp_dir) assert len(tuple(tmp_dir.iterdir())) == 0
def test_clean_do_not_remove_hidden_files(tmp_dir): pth = tmp_dir / ".toto.pyc" pth.write_text("toto") clean(tmp_dir) assert pth.exists()
def test_clean_remove_pyc_files(tmp_dir): pth = tmp_dir / "toto.pyc" pth.write_text("toto") clean(tmp_dir) assert not pth.exists()
def test_clean_do_not_explore_hidden_directories(tmp_dir): hidden = tmp_dir + "/" + ".test" mkdir(hidden) name = hidden + "/" + "toto.py" with open(name, 'w') as f: f.write("toto") clean(tmp_dir) assert exists(hidden) assert exists(name)
def test_clean_remove_pycache_directories(tmp_dir): pycache = tmp_dir + "/" + "__pycache__" mkdir(pycache) name = pycache + "/" + "toto.py" with open(name, 'w') as f: f.write("toto") clean(tmp_dir) assert not exists(pycache) assert not exists(name)
def test_clean_do_not_explore_hidden_directories(): hidden = tmp_dir + "/" + ".test" mkdir(hidden) name = hidden + "/" + "toto.py" with open(name, 'w') as f: f.write("toto") clean(tmp_dir) assert exists(hidden) assert exists(name)
def test_clean_remove_pycache_directories(): pycache = tmp_dir + "/" + "__pycache__" mkdir(pycache) name = pycache + "/" + "toto.py" with open(name, 'w') as f: f.write("toto") clean(tmp_dir) assert not exists(pycache) assert not exists(name)
def test_clean_do_not_explore_hidden_directories(tmp_dir): hidden = tmp_dir / ".test" ensure_created(hidden) pth = hidden / "toto.py" pth.write_text("toto") clean(tmp_dir) assert hidden.exists() assert pth.exists()
def test_clean_remove_pycache_directories(tmp_dir): pycache = tmp_dir / "__pycache__" ensure_created(pycache) pth = pycache / "toto.py" pth.write_text("toto") clean(tmp_dir) assert not pycache.exists() assert not pth.exists()
def test_clean_remove_dist_build_directories(tmp_dir): for name in ("dist", "build"): mkdir(tmp_dir + "/" + name) clean(tmp_dir) assert len(listdir(tmp_dir)) == 0
def test_clean_remove_dist_build_directories(): for name in ("dist", "build"): mkdir(tmp_dir + "/" + name) clean(tmp_dir) assert len(listdir(tmp_dir)) == 0