(self)
| 118 | self.assertFalse(os.path.exists(pth_file.bad_dir_path)) |
| 119 | |
| 120 | def test_addpackage(self): |
| 121 | # Make sure addpackage() imports if the line starts with 'import', |
| 122 | # adds directories to sys.path for any line in the file that is not a |
| 123 | # comment or import that is a valid directory name for where the .pth |
| 124 | # file resides; invalid directories are not added |
| 125 | pth_file = PthFile() |
| 126 | pth_file.cleanup(prep=True) # to make sure that nothing is |
| 127 | # pre-existing that shouldn't be |
| 128 | try: |
| 129 | pth_file.create() |
| 130 | site.addpackage(pth_file.base_dir, pth_file.filename, set()) |
| 131 | self.pth_file_tests(pth_file) |
| 132 | finally: |
| 133 | pth_file.cleanup() |
| 134 | |
| 135 | def make_pth(self, contents, pth_dir='.', pth_name=TESTFN): |
| 136 | # Create a .pth file and return its (abspath, basename). |
nothing calls this directly
no test coverage detected