]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
tests/codeparser.py: Add filename/lineno flags to test variable
authorOlof Johansson <olof.johansson@axis.com>
Tue, 19 Jan 2016 15:04:11 +0000 (16:04 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 19 Jan 2016 17:42:20 +0000 (17:42 +0000)
A recent change in bitbake added filename/lineno information to the
parameters of bb.data.build_dependencies(). The codeparser tests
required a little adaption to the changes, adding the flags to the FOO
variable used in the tests.

The error seen when running the tests is a TypeError exception raised
in bb.codeparser:

  TypeError: int() argument must be a string or a number, not 'NoneType'

Signed-off-by: Olof Johansson <olof.johansson@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/tests/codeparser.py

index 4454bc51edb60664a2690ded6ddda43e1e35afb6..bb820e40378d4db289e18e5930d926c99340491a 100644 (file)
@@ -293,7 +293,12 @@ bb.data.getVar(a(), d, False)
     def test_python(self):
         self.d.setVar("FOO", self.pydata)
         self.setEmptyVars(["inexpand", "a", "test2", "test"])
-        self.d.setVarFlags("FOO", {"func": True, "python": True})
+        self.d.setVarFlags("FOO", {
+            "func": True,
+            "python": True,
+            "lineno": 1,
+            "filename": "example.bb",
+        })
 
         deps, values = bb.data.build_dependencies("FOO", set(self.d.keys()), set(), set(), self.d)