| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7fca6d7 commit f229821
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,6 +2,7 @@ | |||
| 2 | 2 | import tempfile | |
| 3 | 3 | import unittest | |
| 4 | 4 | ||
| 5 | + from pathlib import Path | ||
| 5 | 6 | from bpython.importcompletion import ModuleGatherer | |
| 6 | 7 | ||
| 7 | 8 | ||
@@ -60,36 +61,24 @@ def setUp(self): | |||
| 60 | 61 | os.mkdir(os.path.join(import_test_folder, "Left")) | |
| 61 | 62 | ||
| 62 | 63 | current_path = os.path.join(import_test_folder, "Level0") | |
| 63 | - with open( | ||
| 64 | - os.path.join(current_path, "__init__.py"), "x" | ||
| 65 | - ) as init_file: | ||
| 66 | - pass | ||
| 64 | + Path(os.path.join(current_path, "__init__.py")).touch() | ||
| 67 | 65 | ||
| 68 | 66 | current_path = os.path.join(current_path, "Level1") | |
| 69 | 67 | os.mkdir(current_path) | |
| 70 | - with open( | ||
| 71 | - os.path.join(current_path, "__init__.py"), "x" | ||
| 72 | - ) as init_file: | ||
| 73 | - pass | ||
| 68 | + Path(os.path.join(current_path, "__init__.py")).touch() | ||
| 74 | 69 | ||
| 75 | 70 | current_path = os.path.join(current_path, "Level2") | |
| 76 | 71 | os.mkdir(current_path) | |
| 77 | - with open( | ||
| 78 | - os.path.join(current_path, "__init__.py"), "x" | ||
| 79 | - ) as init_file: | ||
| 80 | - pass | ||
| 72 | + Path(os.path.join(current_path, "__init__.py")).touch() | ||
| 81 | 73 | ||
| 82 | 74 | os.symlink( | |
| 83 | - os.path.join(import_test_folder, "Level0/Level1"), | ||
| 75 | + os.path.join(import_test_folder, "Level0", "Level1"), | ||
| 84 | 76 | os.path.join(current_path, "Level3"), | |
| 85 | 77 | True, | |
| 86 | 78 | ) | |
| 87 | 79 | ||
| 88 | 80 | current_path = os.path.join(import_test_folder, "Right") | |
| 89 | - with open( | ||
| 90 | - os.path.join(current_path, "__init__.py"), "x" | ||
| 91 | - ) as init_file: | ||
| 92 | - pass | ||
| 81 | + Path(os.path.join(current_path, "__init__.py")).touch() | ||
| 93 | 82 | ||
| 94 | 83 | os.symlink( | |
| 95 | 84 | os.path.join(import_test_folder, "Left"), | |
@@ -98,10 +87,7 @@ def setUp(self): | |||
| 98 | 87 | ) | |
| 99 | 88 | ||
| 100 | 89 | current_path = os.path.join(import_test_folder, "Left") | |
| 101 | - with open( | ||
| 102 | - os.path.join(current_path, "__init__.py"), "x" | ||
| 103 | - ) as init_file: | ||
| 104 | - pass | ||
| 90 | + Path(os.path.join(current_path, "__init__.py")).touch() | ||
| 105 | 91 | ||
| 106 | 92 | os.symlink( | |
| 107 | 93 | os.path.join(import_test_folder, "Right"), | |
| Back | FazBrowse Home | New Git URL |
0 commit comments