(version)
| 121 | |
| 122 | @pytest.fixture |
| 123 | def vegalite_spec(version): |
| 124 | file_version = "v1" if version == 1 else "vlater" |
| 125 | file = os.path.join(rootpath, "vegalite_data", f"vegalite_{file_version}.json") |
| 126 | |
| 127 | if not os.path.exists(file): |
| 128 | raise FileNotFoundError(f"The vegalite data {file} does not exist.") |
| 129 | |
| 130 | with open(file) as f: |
| 131 | spec = json.load(f) |
| 132 | |
| 133 | if version is None or "$schema" in spec: |
| 134 | return spec |
| 135 | |
| 136 | # Sample versions that might show up |
| 137 | schema_version = {2: "v2.6.0", 3: "v3.6.0", 4: "v4.6.0", 5: "v5.1.0"}[version] |
| 138 | spec["$schema"] = f"https://vega.github.io/schema/vega-lite/{schema_version}.json" |
| 139 | |
| 140 | return spec |
| 141 | |
| 142 | |
| 143 | @pytest.mark.parametrize("version", [1, 2, 3, 4, 5, None]) |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…