Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: fix the rest of tests marked as XFAIL #222

Merged
merged 4 commits into from
Aug 24, 2023

Conversation

lzaoral
Copy link
Contributor

@lzaoral lzaoral commented Aug 23, 2023

Resolves: #89
Related: #68

Task.cancel_task always returns NoneType and not bool.  Moreover, it
catches any instance of MultipleObjectsReturned and ObjectDoesNotExist
and reraises them only as a plain Exception.  Therefore, cancel_subtasks
should catch plain Exceptions.

Fixes the following traceback:
```
    def cancel_subtasks(self):
        """Cancel all subtasks of the task."""
        result = True
        for task in self.subtasks():
            try:
>               result &= task.cancel_task()
E               TypeError: unsupported operand type(s) for &=: 'bool' and 'NoneType'

kobo/hub/models.py:910: TypeError
```

Resolves: release-engineering#89
... and make the Python 3.7+ part conditional.
'text' is just an alias for 'universal_newlines' so we should test that
as well to cover older Python versions.
@rohanpm rohanpm merged commit 70dd8a6 into release-engineering:master Aug 24, 2023
15 checks passed
@lzaoral lzaoral deleted the fix-tests-part2 branch August 24, 2023 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cancel_subtasks fails to cancel subtasks
2 participants