Commit 1d39d6b
[py] Fix internal error when an unexpected exception is raised while running window_switching_tests (#4654)
This is happening since the switch to use a global driver instance. The
problem is that when a test fails with an exception the
pytest_exception_interact() is called, which quits the driver, and then
the teardown part of the close_windows fixture tries to close the
windows, but window_handles fails because the driver process is no
longer running. We can handle URLError exception when getting the window
handles and simply return without trying to close the windows.1 parent 9a6bbe4 commit 1d39d6b
1 file changed
+13
-1
lines changedLines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
32 | 44 | | |
33 | 45 | | |
34 | 46 | | |
| |||
0 commit comments