Skip to content

Commit

Permalink
fix ruff lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
AAriam committed Nov 11, 2023
1 parent 2093464 commit ac89f21
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespaces = true
# ----------------------------------------- Project Metadata -------------------------------------
#
[project]
version = "0.0.0.dev175"
version = "0.0.0.dev176"
name = "RepoDynamics"
dependencies = [
"packaging >= 23.2, < 24",
Expand Down
15 changes: 13 additions & 2 deletions src/repodynamics/_data/template/testsuite/__init__.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
"""${{ name }} Test-Suite

${{license.notice}}
"""

import subprocess


def run(path_root: str = ".", path_config: str = "pyproject.toml"):
cmd = ["pytest", f"--rootdir={path_root}", f"--config-file={path_config}"]
process = subprocess.run(cmd, text=True, cwd=path_root, capture_output=False)
"""Run the test-suite."""
process = subprocess.run(
["pytest", f"--rootdir={path_root}", f"--config-file={path_config}"],
text=True,
cwd=path_root,
capture_output=False,
check=True
)
return
3 changes: 3 additions & 0 deletions src/repodynamics/_data/template/testsuite/__main__.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""Run all tests for the package."""


import ${{package.name}}_tests as testsuite

testsuite.run()
6 changes: 5 additions & 1 deletion src/repodynamics/_data/template/testsuite/general_tests.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
"""General tests for the package"""


import ${{package.name}} as pkg


def version_test():
"""Sample test"""
min_len_ver_elements = 3
assert isinstance(pkg.__version__, str)
assert len(pkg.__version__.split(".")) >= 3
assert len(pkg.__version__.split(".")) >= min_len_ver_elements
return

0 comments on commit ac89f21

Please sign in to comment.