summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorOla x Nilsson <ola.x.nilsson@axis.com>2019-10-21 12:30:26 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-10-23 16:30:36 +0100
commit864c8d67f2e5f0c0d474f37a9855fc83225038d4 (patch)
treee842abf6fdf898c6fdc98cdb3d3e67c76cc78fac /meta/lib
parent1cf01c03519894500027968db09764fbca3bc779 (diff)
downloadpoky-864c8d67f2e5f0c0d474f37a9855fc83225038d4.tar.gz
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>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/selftest/cases/recipetool.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/meta/lib/oeqa/selftest/cases/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py
index 1c701a40bf..c1562c63b2 100644
--- a/meta/lib/oeqa/selftest/cases/recipetool.py
+++ b/meta/lib/oeqa/selftest/cases/recipetool.py
@@ -685,7 +685,9 @@ class RecipetoolAppendsrcTests(RecipetoolAppendsrcBase):
685 685
686 self._test_appendsrcfile(testrecipe, filepath, srcdir=subdir) 686 self._test_appendsrcfile(testrecipe, filepath, srcdir=subdir)
687 bitbake('%s:do_unpack' % testrecipe) 687 bitbake('%s:do_unpack' % testrecipe)
688 self.assertEqual(open(self.testfile, 'r').read(), open(os.path.join(srcdir, filepath), 'r').read()) 688 with open(self.testfile, 'r') as testfile:
689 with open(os.path.join(srcdir, filepath), 'r') as makefilein:
690 self.assertEqual(testfile.read(), makefilein.read())
689 691
690 def test_recipetool_appendsrcfiles_basic(self, destdir=None): 692 def test_recipetool_appendsrcfiles_basic(self, destdir=None):
691 newfiles = [self.testfile] 693 newfiles = [self.testfile]