Remove some version control directories and some temp editor files.
(self, test_dir)
| 180 | return test_run_temp_subdir |
| 181 | |
| 182 | def remove_vcs(self, test_dir): |
| 183 | """ |
| 184 | Remove some version control directories and some temp editor files. |
| 185 | """ |
| 186 | vcses = ("CVS", ".svn", ".git", ".hg") |
| 187 | for root, dirs, files in os.walk(test_dir): |
| 188 | for vcs_dir in vcses: |
| 189 | if vcs_dir in dirs: |
| 190 | for vcsroot, vcsdirs, vcsfiles in os.walk(test_dir): |
| 191 | for vcsfile in vcsdirs + vcsfiles: |
| 192 | vfile = path.join(vcsroot, vcsfile) |
| 193 | fileutils.chmod(vfile, fileutils.RW, recurse=False) |
| 194 | shutil.rmtree(path.join(root, vcs_dir), False) |
| 195 | |
| 196 | # editors temp file leftovers |
| 197 | tilde_files = [ |
| 198 | path.join(root, file_loc) for file_loc in files if file_loc.endswith("~") |
| 199 | ] |
| 200 | for tf in tilde_files: |
| 201 | os.remove(tf) |
| 202 | |
| 203 | def __extract(self, test_path, extract_func=None, verbatim=False, filter=None): |
| 204 | """ |
no test coverage detected