Skip to content

Commit 316cfba

Browse files
committed
Minor pylint fixes to examples and tests
1 parent 84681f2 commit 316cfba

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

{{cookiecutter.package_name}}/examples/quickstart.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
"""
1+
"""Quickstart example
2+
23
This example script imports the {{cookiecutter.package_name}} package and
34
prints out the version.
45
"""
56

67
import {{cookiecutter.package_name}}
78

89

9-
def main():
10+
def main() -> None:
11+
"""Begin execution"""
1012
print(f"{{cookiecutter.package_name}} version: {% raw -%}
1113
{
1214
{%- endraw %}{{cookiecutter.package_name}}.__version__{% raw -%}

{{cookiecutter.package_name}}/tests/test_examples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class ExamplesTestCase(unittest.TestCase):
2525
in a subprocess.
2626
"""
2727

28-
def run_in_venv(self, filepath, timeout=5.0, **kwargs):
28+
def run_in_venv(self, filepath: str, timeout = 5.0, **kwargs) -> bool:
2929
"""Run a Python script in a virtual env in a subprocess.
3030
3131
filepath references must be relative to the repo root directory.

{{cookiecutter.package_name}}/tests/test_version.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""Version unit tests"""
2+
13
import unittest
24

35
import {{cookiecutter.package_name}}
@@ -6,7 +8,7 @@
68
class VersionTestCase(unittest.TestCase):
79
"""Version tests"""
810

9-
def test_version(self):
11+
def test_version(self) -> None:
1012
"""check {{cookiecutter.package_name}} exposes a version attribute"""
1113
self.assertTrue(hasattr({{cookiecutter.package_name}}, "__version__"))
1214
self.assertIsInstance({{cookiecutter.package_name}}.__version__, str)

0 commit comments

Comments
 (0)