mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
test_runner: Add error handling for test directory clean up.
It was discovered that errors such as:
`OSError: [Errno 16] Device or resource busy`
potentially arise when running in serial mode, or with
explicit test cases passed to `test-backend`.
This commit is contained in:
@@ -479,8 +479,11 @@ class Runner(DiscoverRunner):
|
||||
os.remove(filepath)
|
||||
|
||||
# Clean up our test runs root directory.
|
||||
if os.path.exists(TEST_RUN_DIR):
|
||||
try:
|
||||
shutil.rmtree(TEST_RUN_DIR)
|
||||
except OSError:
|
||||
print("Unable to clean up the test run's directory.")
|
||||
pass
|
||||
return super().teardown_test_environment(*args, **kwargs)
|
||||
|
||||
def test_imports(self, test_labels: List[str], suite: unittest.TestSuite) -> None:
|
||||
|
||||
Reference in New Issue
Block a user