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:
Oliver Smith 2023-07-24 09:03:25 +02:00
parent a806835441
commit 685f2fa9a8
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 1 additions and 1 deletions

View File

@ -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