gabriel / musehub public
conftest.py python
57 lines 1.8 KB
Raw
sha256:3124154ed73a175f93e9a4fecc7aeeac8debf6b6ef7f01b45227c9f60a4128d3 test(install_e2e): the wheelhouse carries the earlier relea… Opus 5.5 18 hours ago
1 """Session fixtures: one candidate sdist and one wheelhouse shared by every installer run."""
2
3 from __future__ import annotations
4
5 import os
6 import pathlib
7 from collections.abc import Callable
8
9 import pytest
10
11 from tests.install_e2e import harness
12
13 pytestmark = pytest.mark.install_e2e
14
15
16 @pytest.fixture(scope="session")
17 def candidate_sdist(tmp_path_factory: pytest.TempPathFactory) -> pathlib.Path:
18 return harness.build_candidate_sdist(tmp_path_factory.mktemp("candidate"))
19
20
21 def _released(env: str, name: str) -> pathlib.Path:
22 path = pathlib.Path(os.environ.get(env, harness.CHECKOUT / "dist" / name))
23 assert path.is_file(), f"released sdist not found: {path} (set {env})"
24 return path
25
26
27 @pytest.fixture(scope="session")
28 def previous_sdist() -> pathlib.Path:
29 """The previously released Muse (rc18, the version with no manifest and no grammars)."""
30 return _released("MUSE_PREVIOUS_SDIST", "muse-0.2.1rc18.tar.gz")
31
32
33 @pytest.fixture(scope="session")
34 def older_sdist() -> pathlib.Path:
35 return _released("MUSE_OLDER_SDIST", "muse-0.2.1rc17.tar.gz")
36
37
38 @pytest.fixture(scope="session")
39 def wheelhouse(tmp_path_factory: pytest.TempPathFactory, candidate_sdist: pathlib.Path) -> pathlib.Path:
40 house = harness.build_wheelhouse(tmp_path_factory.mktemp("wheelhouse"), candidate_sdist)
41 harness.write_stub_swift_wheel(house)
42 return house
43
44
45 @pytest.fixture()
46 def sandbox(tmp_path: pathlib.Path, wheelhouse: pathlib.Path) -> harness.Sandbox:
47 return harness.Sandbox(tmp_path, wheelhouse)
48
49
50 @pytest.fixture()
51 def make_sandbox(tmp_path: pathlib.Path, wheelhouse: pathlib.Path) -> Callable[[str], harness.Sandbox]:
52 def make(name: str) -> harness.Sandbox:
53 root = tmp_path / name
54 root.mkdir()
55 return harness.Sandbox(root, wheelhouse)
56
57 return make
File History 3 commits
sha256:3124154ed73a175f93e9a4fecc7aeeac8debf6b6ef7f01b45227c9f60a4128d3 test(install_e2e): the wheelhouse carries the earlier relea… Opus 5.5 18 hours ago
sha256:8d2339e3feaef5da2c7a3d6304444ec8d569fd4faf340cae62c47486d59fe8b6 feat(install): MUSE_PROFILE/MUSE_EXTRAS/MUSE_WHEELHOUSE and… Opus 5.5 patch 12 days ago
sha256:42b85c455874b92a57e82fafa5bcea5088a00aa5cb41493aadf125cdd9c08fc8 test(install): red e2e + contract tests for profiles, manif… Opus 5.5 patch 12 days ago