From 4e3dabad0be0900a203896c2c2acb270d31b0a42 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Wed, 15 Jun 2022 13:20:41 +1200 Subject: pytest/samdb_api: use TestCaseInTempDir.rm_files Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett Reviewed-by: Noel Power --- python/samba/tests/samdb_api.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'python') diff --git a/python/samba/tests/samdb_api.py b/python/samba/tests/samdb_api.py index a7260180187..710d0bc310f 100644 --- a/python/samba/tests/samdb_api.py +++ b/python/samba/tests/samdb_api.py @@ -29,15 +29,7 @@ class SamDBApiTestCase(TestCaseInTempDir): super(SamDBApiTestCase, self).setUp() def tearDown(self): - try: - os.remove(self.tempdir + "/test.db") - except OSError as e: - self.assertEqual(e.errno, errno.ENOENT) - - try: - os.remove(self.tempdir + "/existing.db") - except OSError as e: - self.assertEqual(e.errno, errno.ENOENT) + self.rm_files("test.db", "existing.db", allow_missing=True) super(SamDBApiTestCase, self).tearDown() -- cgit v1.2.3