[python3] Make unit tests pass in python3
Categories
(Webtools Graveyard :: Pontoon, defect, P2)
Tracking
(Not tracked)
People
(Reporter: mathjazz, Assigned: jotes)
References
Details
Attachments
(6 files)
44 bytes,
text/x-github-pull-request
|
Details | Review | |
44 bytes,
text/x-github-pull-request
|
Details | Review | |
44 bytes,
text/x-github-pull-request
|
Details | Review | |
44 bytes,
text/x-github-pull-request
|
Details | Review | |
44 bytes,
text/x-github-pull-request
|
Details | Review | |
44 bytes,
text/x-github-pull-request
|
Details | Review |
Upgrade to python3 is blocked by the unit tests failures. This bug will track fixes to unit tests needed to make them pass in the python3 environment.
In bug 1362323, :jotes kindly prepared the analysis of the current state of things:
There are 21 types of failures/errors that occur during a test-run on Python 3. Failures/errors sorted by number of occurrences:
118 times - TypeError: object of type 'map' has no len()
53 times - django.db.utils.DataError: invalid regular expression: quantifier operand invalid
14 times - TypeError: can only concatenate list (not "dict_values") to list
11 times - django.http.request.RawPostDataException: You cannot access body after reading from request's data stream
7 times - TypeError: 'dict_values' object is not subscriptable
5 times - TypeError: a bytes-like object is required, not 'str'
4 times - AttributeError: 'bytes' object has no attribute 'traceback'
3 times - TypeError: 'filter' object is not subscriptable
3 times - TypeError: '>=' not supported between instances of 'MagicMock' and 'int'
3 times - assert b'Bad Request: Request must be AJAX' == 'Bad Request: Request must be AJAX' + where b'Bad Request: Request must be AJAX' = <HttpResponseBadRequest status_code=400, "text/html; charset=utf-8">.content
2 times - TypeError: 'odict_values' object is not subscriptable
2 times - KeyError: 'has_next'
1 times - AssertionError: DoesNotExist not raised
1 times - TypeError: argument of type 'ResourceQuerySet' is not iterable
1 times - AssertionError: assert 'p' == 'cl' - p + cl
1 times - AssertionError: assert odict_keys(['...a', 'search']) == ['tag', 'type'...ta', 'search'] Use -v to get the full diff
1 times - ValueError: must have exactly one of create/read/write/append mode
1 times - TypeError: 'odict_items' object is not subscriptable
1 times - AssertionError: assert '^(?s:.)\Z' == '^.$' - ^(?s:.)\Z + ^.$
1 times - pontoon.base.models.DoesNotExist: Translation matching query does not exist.
1 times - TypeError: sequence item 0: expected str instance, bytes found
Detailed analysis of them per file:
https://gist.github.com/jotes/49c64b360ec29ee26efc6455a11fb853
There's a chance that some bigger problems/exceptions are hidden, but I don't think thats a blocker right now.
Reporter | ||
Comment 1•5 years ago
|
||
Reporter | ||
Updated•5 years ago
|
Comment 2•5 years ago
|
||
Reporter | ||
Updated•5 years ago
|
Comment 3•5 years ago
|
||
Comment 4•5 years ago
|
||
Comment 5•5 years ago
|
||
Comment 6•5 years ago
|
||
Comment 7•5 years ago
|
||
Reporter | ||
Comment 8•5 years ago
|
||
Comment 9•4 years ago
|
||
Comment 10•4 years ago
|
||
adngdb merged PR #1479: "Fix bug 1585251 - Fix last failing test with Python 3." in 1e8507b.
This is done! Huge thanks to @jotes who did most of the work, and to @Pike who took a stab at it recently too.
Updated•3 years ago
|
Description
•