Skip to contentSkip to conversation

tests/codeparser.py: Add filename/lineno flags to test variable

PATCH In review Olof Johansson 2 participants 2 messages Jan 19, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/codeparser.py: Add filename/lineno flags to test variable

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'

---
 bitbake/lib/bb/tests/codeparser.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
bitbake/lib/bb/tests/codeparser.py +6 -1
index 4454bc5..bb820e4 100644
@@ -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)
 
Signature · 1 line
2.1.4
#1 lore raw
Quoted 11 lines · Olof Johansson

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'

Thanks. I'm asking awkward questions about why we didn't find that sooner too (if I didn't spot it, our QA infrastructure should have)...

Cheers,

Richard