1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-08 17:19:20 +00:00

oeqa/selftest/recipetool: Use with to control file handle lifetime

(From OE-Core rev: 890fbd77315474fbd582f8bbeb26925c6a42d8d4)

Signed-off-by: Ola x Nilsson <olani@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ola x Nilsson
2019-10-21 12:30:26 +02:00
committed by Richard Purdie
parent 1cf01c0351
commit 864c8d67f2
+3 -1
View File
@@ -685,7 +685,9 @@ class RecipetoolAppendsrcTests(RecipetoolAppendsrcBase):
self._test_appendsrcfile(testrecipe, filepath, srcdir=subdir)
bitbake('%s:do_unpack' % testrecipe)
self.assertEqual(open(self.testfile, 'r').read(), open(os.path.join(srcdir, filepath), 'r').read())
with open(self.testfile, 'r') as testfile:
with open(os.path.join(srcdir, filepath), 'r') as makefilein:
self.assertEqual(testfile.read(), makefilein.read())
def test_recipetool_appendsrcfiles_basic(self, destdir=None):
newfiles = [self.testfile]