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

Commit d318e60

Browse files
committed
fix test_new_module
1 parent 83ac931 commit d318e60

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

src/python3_pip_skeleton/__main__.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,12 @@
1616
# The name of the merge branch that will be created
1717
MERGE_BRANCH = "skeleton-merge-branch"
1818
# Extensions to change
19-
CHANGE_SUFFIXES = [".py", ".rst", ".cfg", ""]
19+
CHANGE_SUFFIXES = [".py", ".rst", ".cfg", "", ".toml"]
2020
# Files not to change
21-
IGNORE_FILES = ["CHANGELOG.rst", "test_boilerplate_removed.py", "_version_git.py"]
21+
IGNORE_FILES = ["CHANGELOG.rst", "test_boilerplate_removed.py"]
2222
# Ranges to ignore between
2323
IGNORE_RANGES = {
2424
"CONTRIBUTING.rst": ("\nUpdating the tools\n", None),
25-
"api.rst": (
26-
"Version number as calculated by",
27-
"https://github.com/epics-containers/versiongit",
28-
),
2925
}
3026
SKELETON_ROOT_COMMIT = "ededf00035e6ccfac78946213009c1ecd7c110a9"
3127

@@ -94,7 +90,7 @@ def replace_text(text: str) -> str:
9490
git_tmp("pull", SKELETON, "skeleton")
9591
# Move things around
9692
git_tmp("mv", "src/python3_pip_skeleton", f"src/{package}")
97-
git_tmp("mv", "tests/test_python3_pip_skeleton.py", f"tests/test_{package}.py")
93+
git_tmp("mv", "tests/test_dls_python3_skeleton.py", f"tests/test_{package}.py")
9894
# Change contents of all children known to git
9995
for relative_child in git_tmp("ls-files").splitlines():
10096
child = Path(git_tmp.name) / relative_child
@@ -170,7 +166,7 @@ def new(args):
170166
path.mkdir(parents=True)
171167

172168
package = validate_package(args)
173-
git("init", cwd=path)
169+
git("init", "-b", "main", cwd=path)
174170
print(f"Created git repo in {path}")
175171
merge_skeleton(
176172
path=path,
Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,29 @@ def test_new_module(tmp_path: Path):
4747
versiongit_lines = [
4848
line
4949
for line in (module / "docs" / "reference" / "api.rst").read_text().splitlines()
50-
if "versiongit" in line
50+
if "setuptools" in line
5151
]
52-
assert " Version number as calculated by setuptools_scm" in versiongit_lines
52+
assert (
53+
" Version number as calculated by https://github.com/pypa/setuptools_scm"
54+
in versiongit_lines
55+
)
5356
assert (module / "src" / "my_module").is_dir()
5457
assert check_output("git", "branch", cwd=module).strip() == "* main"
5558
check_output("virtualenv", ".venv", cwd=module)
5659
check_output(".venv/bin/pip", "install", ".[dev]", cwd=module)
57-
check_output(".venv/bin/tox", "-e", "docs", cwd=module)
60+
check_output(
61+
".venv/bin/sphinx-build",
62+
"-EWT",
63+
"--keep-going",
64+
"docs",
65+
"build/html",
66+
cwd=module,
67+
)
5868
with pytest.raises(ValueError) as ctx:
59-
check_output(".venv/bin/pytest", "tests", cwd=module)
69+
check_output(module / ".venv/bin/pytest", "tests", cwd=module)
6070
out = ctx.value.args[0]
6171
print(out)
62-
assert "6 failed, 5 passed" in out
72+
assert "6 failed, 4 passed" in out
6373
assert "Please change description in ./setup.cfg" in out
6474
assert "Please change ./README.rst" in out
6575
assert "Please change ./docs/reference/api.rst" in out

0 commit comments

Comments
 (0)