Change the current working directory to `path` to do somthing and then recover the current cwd when it's done.
(path)
| 183 | |
| 184 | @contextmanager |
| 185 | def cwd(path): |
| 186 | """ |
| 187 | Change the current working directory to `path` to do somthing and then |
| 188 | recover the current cwd when it's done. |
| 189 | """ |
| 190 | old_dir = os.getcwd() |
| 191 | os.chdir(path) |
| 192 | try: |
| 193 | yield |
| 194 | finally: |
| 195 | os.chdir(old_dir) |
| 196 | |
| 197 | |
| 198 | def running_on_ci(): |
no outgoing calls