From: Douglas Bagnall Date: Wed, 15 Jun 2022 01:20:41 +0000 (+1200) Subject: pytest/samdb_api: use TestCaseInTempDir.rm_files X-Git-Tag: talloc-2.4.0~1203 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4e3dabad0be0900a203896c2c2acb270d31b0a42;p=thirdparty%2Fsamba.git pytest/samdb_api: use TestCaseInTempDir.rm_files Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett Reviewed-by: Noel Power --- 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()