def test_clean_do_not_remove_py_files(): name = tmp_dir + "/" + "toto.py" with open(name, 'w') as f: f.write("toto") clean(tmp_dir) 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(): 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)