Skip to content

Commit bbb648c

Browse files
committed
Add testing in invoke
1 parent 835a2da commit bbb648c

File tree

1 file changed

+28
-14
lines changed

1 file changed

+28
-14
lines changed

tasks.py

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@
33
from pathlib import Path
44

55
from invoke import task
6-
from rellu import initialize_labels, ReleaseNotesGenerator, Version
7-
from rellu.tasks import clean
8-
6+
from rellu import ReleaseNotesGenerator, Version, initialize_labels
7+
from rellu.tasks import clean # noqa
98

109
assert Path.cwd() == Path(__file__).parent
1110

1211

13-
REPOSITORY = 'robotframework/PythonLibCore'
14-
VERSION_PATH = Path('src/robotlibcore.py')
15-
RELEASE_NOTES_PATH = Path('docs/PythonLibCore-{version}.rst')
16-
RELEASE_NOTES_TITLE = 'Python Library Core {version}'
17-
RELEASE_NOTES_INTRO = '''
12+
REPOSITORY = "robotframework/PythonLibCore"
13+
VERSION_PATH = Path("src/robotlibcore.py")
14+
RELEASE_NOTES_PATH = Path("docs/PythonLibCore-{version}.rst")
15+
RELEASE_NOTES_TITLE = "Python Library Core {version}"
16+
RELEASE_NOTES_INTRO = """
1817
`Python Library Core`_ is a generic component making it easier to create
1918
bigger `Robot Framework`_ test libraries. Python Library Core {version} is
2019
a new release with **UPDATE** enhancements and bug fixes. **MORE intro stuff**
@@ -47,7 +46,7 @@
4746
.. _pip: http://pip-installer.org
4847
.. _PyPI: https://pypi.python.org/pypi/robotframework-robotlibcore
4948
.. _issue tracker: https://github.com/robotframework/PythonLibCore/issues?q=milestone%3A{version.milestone}
50-
'''
49+
"""
5150

5251

5352
@task
@@ -99,8 +98,7 @@ def release_notes(ctx, version=None, username=None, password=None, write=False):
9998
"""
10099
version = Version(version, VERSION_PATH)
101100
file = RELEASE_NOTES_PATH if write else sys.stdout
102-
generator = ReleaseNotesGenerator(REPOSITORY, RELEASE_NOTES_TITLE,
103-
RELEASE_NOTES_INTRO)
101+
generator = ReleaseNotesGenerator(REPOSITORY, RELEASE_NOTES_TITLE, RELEASE_NOTES_INTRO)
104102
generator.generate(version, username, password, file)
105103

106104

@@ -120,14 +118,15 @@ def init_labels(ctx, username=None, password=None):
120118
"""
121119
initialize_labels(REPOSITORY, username, password)
122120

121+
123122
@task
124123
def lint(ctx):
125124
print("Run flake8")
126-
ctx.run("flake8 --config .flake8 src/")
125+
ctx.run("flake8 --config .flake8 src/ tasks.py")
127126
print("Run black")
128-
ctx.run("black --target-version py36 --line-length 120 src/")
127+
ctx.run("black --target-version py36 --line-length 120 src/ tasks.py")
129128
print("Run isort")
130-
ctx.run("isort src/")
129+
ctx.run("isort src/ tasks.py")
131130
print("Run tidy")
132131
in_ci = os.getenv("GITHUB_WORKFLOW")
133132
print(f"Lint Robot files {'in ci' if in_ci else ''}")
@@ -141,3 +140,18 @@ def lint(ctx):
141140
command.insert(1, "--check")
142141
command.insert(1, "--diff")
143142
ctx.run(" ".join(command))
143+
144+
145+
@task
146+
def atest(ctx):
147+
ctx.run("python atest/run.py")
148+
149+
150+
@task
151+
def utest(ctx):
152+
ctx.run("python utest/run.py")
153+
154+
155+
@task(utest, atest)
156+
def test(ctx):
157+
pass

0 commit comments

Comments
 (0)