Commit Graph

9 Commits

Author SHA1 Message Date
Pulkit Goyal
bc1d2102b1 py3: make test-demandimport use print_function
Replacing print statements with print function.
2016-04-16 12:41:58 +05:30
Bryan O'Sullivan
3002054ec0 test-demandimport: ensure that relative imports are deferred
This adds a test not just at our local "top level" (the mercurial
package), but also one level deeper (mercurial.hgweb).
2015-12-23 16:22:20 -08:00
Augie Fackler
ffd2cf1dba demandimport: blacklist distutils.msvc9compiler (issue4475)
This module depends on _winreg, which is windows-only. Recent versions
of setuptools load distutils.msvc9compiler and expect it to
ImportError immediately when on non-Windows platforms, so we need to
let them do that. This breaks in an especially mystifying way, because
setuptools uses vars() on the imported module. We then throw an
exception, which vars doesn't pick up on well. For example:

In [3]: class wat(object):
   ...:     @property
   ...:     def __dict__(self):
   ...:         assert False
   ...:

In [4]: vars(wat())
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-4-2781ada5ffe6> in <module>()
----> 1 vars(wat())

TypeError: vars() argument must have __dict__ attribute

Which is similar to the problem we run into.
2014-12-22 17:27:31 -05:00
Mads Kiilerich
2572d4c880 demandimport: make it possible to disable by setting HGDEMANDIMPORT=disable
Convenient for debugging weird problems that are caused by demandimport or
obfuscated by it.

This is an undocumented developer feature.
2014-04-08 01:35:13 +02:00
Dan Villiom Podlaski Christiansen
165e2565b2 test-demandimport.py: PyPy support
The stringification of sys.stderr is different in PyPy:

$ pypy -c 'import sys; print sys.stderr'
<open file '<fdopen>', mode 'w' at 0x00a42080>

$ python -c 'import sys; print sys.stderr'
<open file '<stderr>', mode 'w' at 0x10025a270>

The test will now ignore the exact value between the angle brackets.
2010-12-01 21:46:08 +01:00
Dan Villiom Podlaski Christiansen
f385faac7a *: kill all unnecessary shebangs. 2010-10-26 12:18:39 +02:00
James Abbatiello
493895e163 Fix test-demandimport and test-trusted under Windows
The Windows-only wrapper around stdout is causing both of these tests to fail.
test-demandimport fails because it tries to print repr(sys.stdout).  Use
stderr instead since that is not wrapped.

test-trusted fails because the wrapper doesn't handle softspace and an
unexpected extra space gets printed.
2009-07-14 22:38:12 -04:00
Martin Geisler
aedc0ac57f tests: removed unnecessary execute bit on Python tests 2009-05-17 01:42:21 +02:00
Martin Geisler
a645da9ed1 tests: renamed Python tests to .py 2009-05-17 01:39:31 +02:00