- 09 May, 2024 40 commits
-
-
Jérome Perrin authored
This test assumed that activating a method with a string of length `n+x` as argument would be serialized in `x` more bytes that activating the same method with a string of length `n` as argument, which is only true for protocol 0 for multiple reasons ( short strings and long strings are serialized differently, "frames" are used with protocol 5) and db.string_literal seems to introduce a difference. Change the test to mock Message.dump to produce longer dumps instead of relying on this assumption.
-
Jérome Perrin authored
on python2, we use have a [python patch][patch] to globally make asyncore use poll, at that time we were using medusa and it was not exposing an option to use something else than select. [patch]: https://lab.nexedi.com/nexedi/slapos/-/blob/180f1553fa7774f05ae8e739dfef43fa2ae56c0a/component/python-2.7/asyncore_poll_insteadof_select.patch
-
Jérome Perrin authored
-
Jérome Perrin authored
-
Jérome Perrin authored
-
Jérome Perrin authored
-
Jérome Perrin authored
also add the missing tests
-
Jérome Perrin authored
-
Jérome Perrin authored
new test with ERP5-style workflow to cover python3 migration
-
Jérome Perrin authored
-
Jérome Perrin authored
-
Carlos Ramos Carreño authored
The e-mail messages are normalized in a way compatible with both Python 2 and Python 3. In Python 2, the previous version added a `unixfrom`, which contains the date, making the tests fail when there is a change of one second in the clock between generating the first and the second message. Moreover, the second message contained a previous `unixfrom`. This has been solved by removing `unixfrom` in the normalized string. In Python 3, messages had an inconsistent folding, due to https://github.com/python/cpython/issues/72649 . This has been solved by manual unfolding (using a regex substitution) and by outputing normalized strings without folding (setting `maxheaderlen=0`, which means no maximum line lenght). With these changes, the normalized string can be compared in both versions without problems.
-
Carlos Ramos Carreño authored
-
Carlos Ramos Carreño authored
The if in this change was not being reached in Python 2, because in this version the repr includes a comma after the message. I have chosen instead to do the same that was being done before commit 9f4cf295, but changing `message` (which does not exist in Python 3) to `args[0]` which can be used in both Python versions.
-
Carlos Ramos Carreño authored
-
Carlos Ramos Carreño authored
Newer versions of polib accept only unicode strings in the `pofile` function (because they check if they start by the decoded version of the BOM). I changed the `data` that is passed to `pofile` to be a unicode string in Python 2 too. This seems to work locally in my old version of polib, so that at least the old behavior should be kept the same.
-
Carlos Ramos Carreño authored
-
Carlos Ramos Carreño authored
Fixes an assert due to a unicode/bytes mismatch.
-
Carlos Ramos Carreño authored
- The warnings are compared in a set instead of a list, as we do not care of how many times is the warning raised. - The warning filter is added inside the context manager, as recommended in https://docs.python.org/2.7/library/warnings.html#testing-warnings . - We change the `clear` method of list, using `del` instead, as the `clear` method was added on Python 3.3.
-
Jérome Perrin authored
Drop old test adjustments, we only test DateTime >= 3 nowadays. Make the condition for test_pickle_old_with_micros_as_float based on python version for simplicity.
-
Jérome Perrin authored
-
Jérome Perrin authored
-
Jérome Perrin authored
-
Jérome Perrin authored
-
Jérome Perrin authored
-
Jérome Perrin authored
-
Jérome Perrin authored
-
Jérome Perrin authored
this is removed from python3, it was not so useful here either
-
Jérome Perrin authored
-
Jérome Perrin authored
-
Jérome Perrin authored
-
Jérome Perrin authored
-
Jérome Perrin authored
-
Jérome Perrin authored
-
Jérome Perrin authored
-
Jérome Perrin authored
-
Jérome Perrin authored
-
Jérome Perrin authored
-
Jérome Perrin authored
-
Jérome Perrin authored
-