Running pylinac unit tests fails

I wanted to run the pylinac unit tests locally but it seems (a lot of) source data for the unit tests is using a password protected location at Google.

# uv run pytest
======================================================================================================= test session starts =======================================================================================================
platform win32 -- Python 3.12.6, pytest-8.3.3, pluggy-1.5.0
rootdir: C:\Users\jonathan.martens\Code\pylinac
configfile: pyproject.toml
testpaths: tests_basic
plugins: anyio-4.5.0, cov-5.0.0, xdist-3.6.1
collected 4292 items / 6 errors                                                                                                                                                                                                    

============================================================================================================= ERRORS ==============================================================================================================
_________________________________________________________________________________________ ERROR collecting tests_basic/core/test_gamma.py _________________________________________________________________________________________
tests_basic\core\test_gamma.py:11: in <module>
    from tests_basic.core.test_profile import generate_open_field
<frozen importlib._bootstrap>:1360: in _find_and_load
    ???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:935: in _load_unlocked
    ???
.venv\Lib\site-packages\_pytest\assertion\rewrite.py:184: in exec_module
    exec(co, module.__dict__)
tests_basic\core\test_profile.py:2295: in <module>
    class CircleProfileTestMixin:
tests_basic\core\test_profile.py:2297: in CircleProfileTestMixin
    image_file_location = get_file_from_cloud_test_repo(["Starshot", "Starshot-1.tif"])
tests_basic\utils.py:124: in get_file_from_cloud_test_repo
    with access_gcp() as client:
C:\Python312\Lib\contextlib.py:137: in __enter__
    return next(self.gen)
tests_basic\utils.py:45: in access_gcp
    client = storage.Client.from_service_account_json(str(credentials_file))
.venv\Lib\site-packages\google\cloud\client\__init__.py:107: in from_service_account_json
    credentials_info = json.load(json_fi)
C:\Python312\Lib\json\__init__.py:293: in load
    return loads(fp.read(),
C:\Python312\Lib\json\__init__.py:346: in loads
    return _default_decoder.decode(s)
C:\Python312\Lib\json\decoder.py:337: in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
C:\Python312\Lib\json\decoder.py:355: in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
E   json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

...

===================================================================================================== short test summary info ===================================================================================================== 
ERROR tests_basic/core/test_gamma.py - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
ERROR tests_basic/core/test_image.py - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
ERROR tests_basic/core/test_profile.py - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
ERROR tests_basic/test_dlg.py - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
ERROR tests_basic/test_logs.py - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
ERROR tests_basic/test_plan_generator.py - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 6 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
================================================================================================== 4 warnings, 6 errors in 3.04s ================================================================================================== 

Is there a way I can run the test suite or is everything relying on this proprietary data?

Unfortunately, that is the case. The data I’ve received over the years is in the cloud, but (to my detriment) I didn’t ask whether the donator was okay with the data being public. I’ve opted for privacy which unfortunately makes it tricky for contributors =/.

I’ve added a new question on the pylinac donation form whether the data can be public or not, but that’s relatively new.

There are some datasets that were shared via google groups or some other public avenue. Unfortunately, I didn’t keep track of these vs private shares. Also, it’s rather annoying to apply fine-grained permissions (i.e. file-by-file) to the storage bucket but I’ll likely have to set that up at some point.

You can scour the google group forum for old data.

One thing I can add is “marks” on the tests that will match the open data vs closed data. That way you could run the public subset of tests like so pytest -m public