This new warning came up with pytest 5.4.1 and made some tests fail on Windows:
recwarn = WarningsRecorder(record=True) @pytest.fixture(autouse=True) def no_warnings(recwarn): """Fail on warning.""" yield warnings = [] for warning in recwarn: # pragma: no cover message = str(warning.message) if "sentry_sdk" in warning.filename: continue elif "WaitForInputIdle" in message: # Happen while testing the integration on Windows, we can skip it: # "Application is not loaded correctly (WaitForInputIdle failed)" continue elif "type=SocketKind.SOCK_STREAM" in message: # Socket leaks on macOS, may need investigations continue elif "TerminalReporter.writer attribute is deprecated" in message: # Cannot understand if this is from our code or a pytest plugin, # let's wait for when it will fail :) continue warn = f"{warning.filename}:{warning.lineno} {message}" print(warn, file=sys.stderr) warnings.append(warn) > assert not warnings E assert not ["C:\\Jenkins\\workspace\\Drive\\Drive-OS-test-jobs\\Drive-tests-windows-master\\deploy-dir\\3.7.4\\lib\\site-packages...ocal\\\\temp\\\\pytest-of-jenkins\\\\garbage-5b060f31-7022-4d82-9045-e09bbee235a3\\\\test_trash_long_file0\\\\1'", ...] message = "(rm_rf) error removing C:\\Users\\jenkins\\AppData\\Local\\temp\\pytest-of-jenkins\\garbage-5b060f31-7022-4d82-9045-e...\\\\Users\\\\jenkins\\\\AppData\\\\Local\\\\temp\\\\pytest-of-jenkins\\\\garbage-5b060f31-7022-4d82-9045-e09bbee235a3'" recwarn = WarningsRecorder(record=True) warn = "C:\\Jenkins\\workspace\\Drive\\Drive-OS-test-jobs\\Drive-tests-windows-master\\deploy-dir\\3.7.4\\lib\\site-packages\...\\\\Users\\\\jenkins\\\\AppData\\\\Local\\\\temp\\\\pytest-of-jenkins\\\\garbage-5b060f31-7022-4d82-9045-e09bbee235a3'" warning = <warnings.WarningMessage object at 0x03B563F0> warnings = ["C:\\Jenkins\\workspace\\Drive\\Drive-OS-test-jobs\\Drive-tests-windows-master\\deploy-dir\\3.7.4\\lib\\site-packages...ocal\\\\temp\\\\pytest-of-jenkins\\\\garbage-5b060f31-7022-4d82-9045-e09bbee235a3\\\\test_trash_long_file0\\\\1'", ...]