Skip to content

Commit 60c2fc6

Browse files
authored
Skip pytask_collect_task_teardown if task is None. (#34)
1 parent 6258670 commit 60c2fc6

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

docs/changes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ all releases are available on `Anaconda.org <https://anaconda.org/pytask/pytask>
1212
- :gh:`31` adds ``pytask collect`` to show information on collected tasks.
1313
- :gh:`32` fixes ``pytask clean``.
1414
- :gh:`33` adds a module to apply common parameters to the command line interface.
15+
- :gh:`34` skips ``pytask_collect_task_teardown`` if task is None.
1516

1617

1718
0.0.8 - 2020-10-04

docs/rtd_environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
channels:
22
- conda-forge
33
dependencies:
4-
- python
4+
- python=3.8
55
- ipython
66
- sphinx
77
- sphinx-copybutton

src/_pytask/collect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ def pytask_collect_task_protocol(session, reports, path, name, obj):
128128
task = session.hook.pytask_collect_task(
129129
session=session, path=path, name=name, obj=obj
130130
)
131-
session.hook.pytask_collect_task_teardown(session=session, task=task)
132131
if task is not None:
132+
session.hook.pytask_collect_task_teardown(session=session, task=task)
133133
return CollectionReportTask.from_task(task)
134134

135135
except Exception:

0 commit comments

Comments
 (0)