1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/units
Marius Gedminas 1a1c9203e2 Python 3: fix TypeError: unorderable types in test
The full error was

======================================================================
ERROR: test_task_executor_execute (units.executor.test_task_executor.TestTaskExecutor)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mg/src/ansible/test/units/executor/test_task_executor.py", line 252, in test_task_executor_execute
    mock_action.run.return_value = dict(ansible_facts=dict())
  File "/home/mg/src/ansible/lib/ansible/executor/task_executor.py", line 317, in _execute
    if self._task.async > 0:
TypeError: unorderable types: MagicMock() > int()

----------------------------------------------------------------------

Experiments show that Python 2 MagicMock() > 0 is true, so I'm setting
the async property on mock_task to 1.  (If I set it to 0, the test fails
anyway.)
2015-09-07 09:49:28 +03:00
..
errors Making the switch to v2 2015-05-03 21:47:26 -05:00
executor Python 3: fix TypeError: unorderable types in test 2015-09-07 09:49:28 +03:00
inventory_test_data/group_vars Merge branch 'v2_final' into devel_switch_v2 2015-05-28 15:26:03 -05:00
mock Starting to add additional unit tests for VariableManager 2015-09-04 16:41:38 -04:00
module_utils Use 0oNNN octal syntax in test/ 2015-08-27 22:15:57 +03:00
parsing Starting to add additional unit tests for VariableManager 2015-09-04 16:41:38 -04:00
playbook simplify become testing and handling, we had drifted and were doulbe checking prompt, become and become_pass 2015-09-04 10:36:16 -04:00
plugins Simplify FactCache.copy() 2015-09-03 09:44:44 +03:00
template Do not escape backslashes when processing a template file. 2015-09-03 17:45:17 -07:00
utils Cleanup combine_vars 2015-09-01 11:23:12 -07:00
vars Starting to add additional unit tests for VariableManager 2015-09-04 16:41:38 -04:00
__init__.py Making the switch to v2 2015-05-03 21:47:26 -05:00