Create a temporary folder structure like the following: test_find_dotenv0/ └── child1 ├── child2 │ └── child3 │ └── child4 └── .env Then try to automatically `find_dotenv` starting in `child4`
(path)
| 200 | |
| 201 | |
| 202 | def prepare_file_hierarchy(path): |
| 203 | """ |
| 204 | Create a temporary folder structure like the following: |
| 205 | |
| 206 | test_find_dotenv0/ |
| 207 | └── child1 |
| 208 | ├── child2 |
| 209 | │ └── child3 |
| 210 | │ └── child4 |
| 211 | └── .env |
| 212 | |
| 213 | Then try to automatically `find_dotenv` starting in `child4` |
| 214 | """ |
| 215 | |
| 216 | curr_dir = path |
| 217 | dirs = [] |
| 218 | for f in ['child1', 'child2', 'child3', 'child4']: |
| 219 | curr_dir /= f |
| 220 | dirs.append(curr_dir) |
| 221 | curr_dir.mkdir() |
| 222 | |
| 223 | return (dirs[0], dirs[-1]) |
| 224 | |
| 225 | |
| 226 | def test_find_dotenv_no_file_raise(tmp_path): |
no outgoing calls
no test coverage detected