mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07:00
Add a comment explaining why async = 1 in the test
This commit is contained in:
parent
1a1c9203e2
commit
c22f4ee697
1 changed files with 4 additions and 0 deletions
|
@ -220,6 +220,10 @@ class TestTaskExecutor(unittest.TestCase):
|
||||||
mock_task.changed_when = None
|
mock_task.changed_when = None
|
||||||
mock_task.failed_when = None
|
mock_task.failed_when = None
|
||||||
mock_task.post_validate.return_value = None
|
mock_task.post_validate.return_value = None
|
||||||
|
# mock_task.async cannot be left unset, because on Python 3 MagicMock()
|
||||||
|
# > 0 raises a TypeError There are two reasons for using the value 1
|
||||||
|
# here: on Python 2 comparing MagicMock() > 0 returns True, and the
|
||||||
|
# other reason is that if I specify 0 here, the test fails. ;)
|
||||||
mock_task.async = 1
|
mock_task.async = 1
|
||||||
|
|
||||||
mock_play_context = MagicMock()
|
mock_play_context = MagicMock()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue