(self, env, extra_path)
| 123 | "/path/to/other_package", |
| 124 | ]) |
| 125 | def test_prepend_pythonpath(self, env, extra_path): |
| 126 | # Save old path to be able to restore it after executing the test |
| 127 | old_path = sys.path.copy() |
| 128 | |
| 129 | env._prepend_pythonpath = extra_path |
| 130 | prepend_pythonpath(env) |
| 131 | if extra_path is not None: |
| 132 | assert len(sys.path) == len(old_path) + 1 |
| 133 | assert sys.path[0] == extra_path |
| 134 | else: |
| 135 | assert len(sys.path) == len(old_path) |
| 136 | |
| 137 | # Cleanup |
| 138 | sys.path = old_path |
| 139 | |
| 140 | |
| 141 | class TestEnvironment: |
nothing calls this directly
no test coverage detected