Commit 827f5ac
Improve test isolation
Extend and rename current autouse pytest fixture to
`setup_teardown_test_environment`.
The fixture ensures an isolated test environment.
It creates a new temporary directory which is used as working directory.
This ensures a clean start for each test and prevents tests from
affecting another one through changes to the working directory.
The fixture ensures that the user's actual configuration files are
neither used nor touched during test, as WEST_CONFIG_* env variables are
set, whereby no config files are created at these locations.
The fixture sets ZEPHYR_BASE (to avoid complaints in subcommand stderr),
but to a spurious location (so that attempts to read from inside of it
are caught here).
The fixture also ensures that any environment modifications made by a
test do not leak into subsequent tests, as the environment is restored
when the `update_env` with-block exits.1 parent bb1c7bf commit 827f5ac
1 file changed
+30
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
169 | 181 | | |
| 182 | + | |
170 | 183 | | |
171 | 184 | | |
172 | 185 | | |
173 | 186 | | |
174 | 187 | | |
175 | 188 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
182 | 198 | | |
183 | 199 | | |
184 | 200 | | |
| |||
0 commit comments