diff options
-rw-r--r-- | meta/classes/testimage.bbclass | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass index a76e773853..4db05a4af4 100644 --- a/meta/classes/testimage.bbclass +++ b/meta/classes/testimage.bbclass | |||
@@ -235,9 +235,10 @@ def testimage_main(d): | |||
235 | 235 | ||
236 | tdname = "%s.testdata.json" % image_name | 236 | tdname = "%s.testdata.json" % image_name |
237 | try: | 237 | try: |
238 | td = json.load(open(tdname, "r")) | 238 | with open(tdname, "r") as f: |
239 | except (FileNotFoundError) as err: | 239 | td = json.load(f) |
240 | bb.fatal('File %s Not Found. Have you built the image with INHERIT+="testimage" in the conf/local.conf?' % tdname) | 240 | except FileNotFoundError as err: |
241 | bb.fatal('File %s not found (%s).\nHave you built the image with INHERIT += "testimage" in the conf/local.conf?' % (tdname, err)) | ||
241 | 242 | ||
242 | # Some variables need to be updates (mostly paths) with the | 243 | # Some variables need to be updates (mostly paths) with the |
243 | # ones of the current environment because some tests require them. | 244 | # ones of the current environment because some tests require them. |