Skip to content

Commit 47cbd93

Browse files
committed
make tests pass and github actions
1 parent a719bc0 commit 47cbd93

File tree

2 files changed

+43
-4
lines changed

2 files changed

+43
-4
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Python Tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
- main
8+
push:
9+
branches:
10+
- develop
11+
- main
12+
13+
jobs:
14+
test:
15+
name: Python Tests
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Set up Python
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: '3.10'
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -r requirements.txt
28+
pip install pytest
29+
- name: Run tests
30+
run: pytest tests/

polyapi/deployables.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,15 +225,24 @@ def print_docstring_function_comment(description: str, args: list, returns: dict
225225
arg_type = arg.get('type', '')
226226
desc = arg.get('description', '')
227227
if arg_type:
228-
docstring += f' {name} ({arg_type}): {desc}\n'
228+
docstring += f' {name} ({arg_type}):'
229+
if desc:
230+
docstring += f' {desc}'
231+
docstring += '\n'
229232
else:
230-
docstring += f' {name}: {desc}\n'
233+
docstring += f' {name}:'
234+
if desc:
235+
docstring += f' {desc}'
236+
docstring += '\n'
231237

232238
return_type = returns.get('type', '')
233239
return_description = returns.get('description', '')
234240
if return_type:
235-
docstring += f'\n Returns:\n {return_type}: {return_description}\n'
236-
else:
241+
docstring += f'\n Returns:\n {return_type}:'
242+
if return_description:
243+
docstring += f' {return_description}'
244+
docstring += '\n'
245+
elif return_description:
237246
docstring += f'\n Returns:\n {return_description}\n'
238247

239248
docstring += ' """'

0 commit comments

Comments
 (0)