Fri, 01 Feb 2019 13:20:13 -0800 tests: use unimported modules in test-demandimport.py
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 01 Feb 2019 13:20:13 -0800] rev 41521
tests: use unimported modules in test-demandimport.py contextlib isn't a good module to test because it is likely already imported by code above. Let's use modules that shouldn't have been imported. And let's verify that with asserts. Differential Revision: https://phab.mercurial-scm.org/D5797
Fri, 01 Feb 2019 16:47:29 -0800 py3: conditionalize test-demandimport.py for Python 3
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 01 Feb 2019 16:47:29 -0800] rev 41520
py3: conditionalize test-demandimport.py for Python 3 The Python 3 lazy importer uses the LazyLoader that is part of importlib. On Python 3 and later, LazyLoader is implemented using a custom module type that defines a __getattribute__ which triggers module loading. Furthermore, there are additional differences as well. For example, it appears that Python 3 will return an existing sys.modules entry instead of constructing a new module object. This commit adds additional test coverage for lazy importing behavior to cover the differences between Python 2 and 3. This reveals that the test and some lazy import functionality is kinda busted. For example, the test assumes "contextlib" will be lazy. But in reality an import before it has already imported contextlib! There's definitely room to improve the behavior of the demand importer code, both for Python 2 and 3. But at least the test passes on Python 3 now. Differential Revision: https://phab.mercurial-scm.org/D5796
Fri, 01 Feb 2019 12:09:05 -0800 py3: replace print() with assert in test-demandimport.py
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 01 Feb 2019 12:09:05 -0800] rev 41519
py3: replace print() with assert in test-demandimport.py Behavior of demand imports behaves differently between Python 2 and 3. .out files do not support conditional output the way that .t files do. In order to make this test work on Python 3, we'll need to make the test itself conditional. The first step of this is to port the test to not use a .out file to compare output. Unfortunately, we can't easily use the unittest framework for defining this test because putting import statements in functions changes the behavior of the demand importer (at least on Python 2). So, we effectively replace a bunch of print() with assert statements. This makes the test a bit annoying to debug, as the test will stop at first assertion failure. But we don't exactly have a good alternative. Differential Revision: https://phab.mercurial-scm.org/D5795
Sat, 02 Feb 2019 04:49:42 +0530 py3: pass str into grp.getgrnam
Pulkit Goyal <pulkit@yandex-team.ru> [Sat, 02 Feb 2019 04:49:42 +0530] rev 41518
py3: pass str into grp.getgrnam grp.getgrnam expects str on Python 3. This fixes test-acl.t on Python 3. Differential Revision: https://phab.mercurial-scm.org/D5794
Wed, 30 Jan 2019 03:50:31 +0530 montone: fix addition to list by using .append() instead of '+'
Pulkit Goyal <pulkit@yandex-team.ru> [Wed, 30 Jan 2019 03:50:31 +0530] rev 41517
montone: fix addition to list by using .append() instead of '+' Differential Revision: https://phab.mercurial-scm.org/D5739
Wed, 30 Jan 2019 17:04:26 -0500 tests: give up and make setsockopt() calls optional in the output
Augie Fackler <augie@google.com> [Wed, 30 Jan 2019 17:04:26 -0500] rev 41516
tests: give up and make setsockopt() calls optional in the output I can't figure out what causes these calls to happen or not, and I weary of dealing with them. End the madness for now by marking them all as optional lines of output. Differential Revision: https://phab.mercurial-scm.org/D5762
Thu, 31 Jan 2019 11:12:59 -0500 py3: fix test-remotefilelog-repack.t
Augie Fackler <augie@google.com> [Thu, 31 Jan 2019 11:12:59 -0500] rev 41515
py3: fix test-remotefilelog-repack.t This is uglier, but more obviously correct in my opinion. I guess Python 3 doesn't hang on to the exception as long, which seems reasonable. Differential Revision: https://phab.mercurial-scm.org/D5781
(0) -30000 -10000 -3000 -1000 -300 -100 -30 -10 -7 +7 +10 +30 +100 +300 +1000 +3000 +10000 tip