test: fix running test_build_package.py standalone
Add the "args" fixture to test_skip_already_built, so it correctly initializes logging (and indirectly pmb.helpers.other.cache). With this it becomes possible to run the test file on its own. See "def args" on top of the file for implementation of the "args" fixture. Fix for: $ pytest -xvv test/test_build_package.py … > assert pmb.helpers.other.cache["built"] == {} E TypeError: 'NoneType' object is not subscriptable Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230724070509.1885-2-ollieparanoid@postmarketos.org%3E
This commit is contained in:
parent
a806835441
commit
685f2fa9a8
|
@ -57,7 +57,7 @@ def args_patched(monkeypatch, argv):
|
|||
return pmb.parse.arguments()
|
||||
|
||||
|
||||
def test_skip_already_built():
|
||||
def test_skip_already_built(args):
|
||||
func = pmb.build._package.skip_already_built
|
||||
assert pmb.helpers.other.cache["built"] == {}
|
||||
assert func("test-package", "armhf") is False
|
||||
|
|
Loading…
Reference in New Issue