Skip to content
This repository was archived by the owner on Mar 13, 2024. It is now read-only.

Commit 23cf8ad

Browse files
OCoppingcoretl
authored andcommitted
[WIP] Attempted to merge 'existing' and 'clean existing' tests, 90% of the time throws error but sometimes passes anyway
1 parent 5bbe962 commit 23cf8ad

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

tests/test_dls_python3_skeleton.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,25 @@ def test_existing_module(tmp_path: Path):
9696
"""
9797
)
9898

99-
100-
def test_clean_existing(tmp_path: Path):
10199
MERGE_BRANCH = "skeleton-merge-branch"
102-
module = tmp_path / "scanspec"
103-
__main__.git(
104-
"clone",
105-
"--depth",
106-
"1",
107-
"--branch",
108-
"0.5.3",
109-
"https://github.com/dls-controls/scanspec",
100+
output = check_output(
101+
sys.executable,
102+
"-m",
103+
"dls_python3_skeleton",
104+
"existing",
110105
str(module),
111106
)
112-
__main__.git("checkout", "-b", f"{MERGE_BRANCH}", cwd=str(module))
113-
__main__.git("checkout", "-", cwd=str(module))
107+
assert output.endswith(
108+
f"{MERGE_BRANCH} already exists. \
109+
Please run 'dls-python3-skeleton clean' to remove it."
110+
)
111+
112+
branches = [
113+
x[2:]
114+
for x in str(__main__.git("branch", "--list", cwd=str(module))).split("\n")
115+
]
116+
assert MERGE_BRANCH in branches
117+
# __main__.git("checkout", "-", cwd=str(module))
114118
output = check_output(
115119
sys.executable,
116120
"-m",

0 commit comments

Comments
 (0)