Merge pull request 'test: make sibling-worktree skip test hermetic (closes #283)' (#288) from fix/issue-283-hermetic-walk-root-test into master
This commit was merged in pull request #288.
This commit is contained in:
@@ -206,8 +206,15 @@ class TestRoleSessionRouter(unittest.TestCase):
|
|||||||
|
|
||||||
class TestCheckMidMerge(unittest.TestCase):
|
class TestCheckMidMerge(unittest.TestCase):
|
||||||
def test_skip_scan_walk_root_skips_sibling_worktrees_only(self):
|
def test_skip_scan_walk_root_skips_sibling_worktrees_only(self):
|
||||||
worktree_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
# Hermetic <main>/branches/<worktree> layout (#283): deriving these
|
||||||
main_root = os.path.dirname(os.path.dirname(worktree_root))
|
# paths from __file__ made the test pass only when the suite ran from
|
||||||
|
# a branches/ worktree, because skip_python_scan_walk_root skips a
|
||||||
|
# branches/ walk root only when <project_root>/branches exists.
|
||||||
|
with tempfile.TemporaryDirectory() as tmp:
|
||||||
|
main_root = os.path.join(tmp, "main")
|
||||||
|
worktree_root = os.path.join(main_root, "branches", "fix-issue-1")
|
||||||
|
os.makedirs(os.path.join(worktree_root, "tests"))
|
||||||
|
|
||||||
self.assertFalse(
|
self.assertFalse(
|
||||||
role_session_router.skip_python_scan_walk_root(
|
role_session_router.skip_python_scan_walk_root(
|
||||||
main_root, main_root
|
main_root, main_root
|
||||||
|
|||||||
Reference in New Issue
Block a user