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

Commit 6cfcad6

Browse files
committed
Fix tests
1 parent 80b51b9 commit 6cfcad6

File tree

3 files changed

+18
-98
lines changed

3 files changed

+18
-98
lines changed

.github/workflows/code.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ jobs:
7070
PY_IGNORE_IMPORTMISMATCH: "1"
7171

7272
steps:
73+
- name: Setup git
74+
run: |
75+
git config --global user.email "[email protected]"
76+
git config --global user.name "Your Name"
77+
7378
- name: Setup repo and test
7479
uses: dls-controls/pipenv-run-action@v1
7580
with:

tests/test_boilerplate_removed.py

Lines changed: 0 additions & 96 deletions
This file was deleted.

tests/test_dls_python3_skeleton.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import subprocess
22
import sys
3+
from configparser import ConfigParser
34
from pathlib import Path
45

56
import pytest
67

7-
from dls_python3_skeleton import __main__, __version__
8+
from dls_python3_skeleton import __version__
89

910

1011
def check_output(*args, cwd=None) -> str:
@@ -29,9 +30,19 @@ def test_new_module(tmp_path: Path):
2930
"dls_python3_skeleton",
3031
"new",
3132
"--package=my_module",
33+
"--full-name=Firstname Lastname",
34+
3235
str(module),
3336
)
34-
assert output == ""
37+
assert (
38+
output.strip()
39+
== "Instructions on how to develop this module are in CONTRIBUTING.rst"
40+
)
41+
conf = ConfigParser()
42+
conf.read(module / "setup.cfg")
43+
assert conf["metadata"]["author"] == "Firstname Lastname"
44+
assert conf["metadata"]["author_email"] == "[email protected]"
45+
assert (module / "src" / "my_module").is_dir()
3546
check_output("pipenv", "install", "--dev", cwd=module)
3647
check_output("pipenv", "run", "docs", cwd=module)
3748
with pytest.raises(ValueError) as ctx:

0 commit comments

Comments
 (0)