Commit Graph

46 Commits

Author SHA1 Message Date
R. David Murray
573399a2f6 Curdir needs to be in the path for the test to work on all buildbots.
(I copied this from another import test, but currently this will fail if
TESTFN ends up in /tmp...see issue 2609).
2009-07-09 15:35:33 +00:00
R. David Murray
fbf2cc4d74 Specify umask in execute bit test to get consistent results
and make sure we test resetting all three execute bits.
2009-07-09 13:55:44 +00:00
R. David Murray
00e1f63c6e Make test work with -O. 2009-07-09 02:06:17 +00:00
R. David Murray
8a624a9eb0 Conditionalize test cleanup code to eliminate traceback, which will
hopefully reveal the real problem.
2009-07-09 01:43:41 +00:00
R. David Murray
23a736a4f0 Issue 6070: when creating a compiled file, after copying the mode bits, on
posix zap the execute bit in case it was set on the .py file, since the
compiled files are not directly executable on posix.  Patch by Marco N.
2009-07-07 01:06:13 +00:00
Benjamin Peterson
5c8da86f3a convert usage of fail* to assert* 2009-06-30 22:57:08 +00:00
Kristján Valur Jónsson
89e759d462 Add a test for UNC import paths, see issue 3677 2009-01-24 10:52:26 +00:00
Antoine Pitrou
09cafb6335 Use shutil.rmtree rather than os.rmdir. 2009-01-06 18:34:08 +00:00
Antoine Pitrou
e96d4ea4e2 Issue #1180193: When importing a module from a .pyc (or .pyo) file with
an existing .py counterpart, override the co_filename attributes of all
code objects if the original filename is obsolete (which can happen if the
file has been renamed, moved, or if it is accessed through different paths).
Patch by Ziga Seilnacht and Jean-Paul Calderone.
2009-01-06 18:10:47 +00:00
Nick Coghlan
d2e0938362 Issue #3781: Final cleanup of warnings.catch_warnings and its usage in the test suite. Closes issue w.r.t. 2.6 (R: Brett Cannon) 2008-09-11 12:11:06 +00:00
Brett Cannon
672237dc6c warnings.catch_warnings() now returns a list or None instead of the custom
WarningsRecorder object. This makes the API simpler to use as no special object
must be learned.

Closes issue 3781.
Review by Benjamin Peterson.
2008-09-09 00:49:16 +00:00
Nick Coghlan
b028f50911 Fix issue 3221 by emitting a RuntimeWarning instead of raising SystemError when the parent module can't be found during an absolute import (likely due to non-PEP 361 aware code which sets a module level __package__ attribute) 2008-07-13 14:52:36 +00:00
Benjamin Peterson
14204ad982 Allow test_import to work when it is invoked directly 2008-04-25 21:43:56 +00:00
Martin v. Löwis
16b2e6bd7f Import relimport using a relative import. 2008-03-19 06:00:28 +00:00
Martin v. Löwis
a4d77898db Issue #2400: Allow relative imports to "import *". 2008-03-19 04:39:13 +00:00
Christian Heimes
3403f1589d Fixed #1776. __import__() no longer imports modules by file name 2008-01-09 19:56:33 +00:00
Christian Heimes
4de2263616 Removed non ASCII text from test as requested by Guido. Sorry :/ 2007-11-01 20:11:06 +00:00
Christian Heimes
e18f21c7d4 Backport of import tests for bug http://bugs.python.org/issue1293 and bug http://bugs.python.org/issue1342 2007-11-01 19:48:10 +00:00
Brett Cannon
2ee4128e9b Remove test.test_support.guard_warnings_filter.
test.test_support.catch_warning is more full-featured and provides the same
functionality.

Since guard_warnings_filter was added in 2.6 there is no
backwards-compatibility issues.
2007-08-14 05:51:06 +00:00
Tim Peters
ea5962f86e Whitespace normalization. 2007-03-12 18:07:52 +00:00
Collin Winter
276887b16d Bug #742342: make Python stop segfaulting on infinitely-recursive reload()s. Fixed by patch #922167.
Will backport.
2007-03-12 16:11:39 +00:00
Brett Cannon
6d9520c4f0 Add test.test_support.guard_warnings_filter . This function returns a context
manager that protects warnings.filter from being modified once the context is
exited.
2006-12-13 23:09:53 +00:00
Tim Peters
ef3f32f965 Whitespace normalization. 2006-10-18 05:09:12 +00:00
Georg Brandl
54c3db55a2 Convert test_import to unittest. 2006-09-30 12:16:03 +00:00
Thomas Wouters
9df4e6f673 - Add new Warning class, ImportWarning
- Warn-raise ImportWarning when importing would have picked up a directory
   as package, if only it'd had an __init__.py. This swaps two tests (for
   case-ness and __init__-ness), but case-test is not really more expensive,
   and it's not in a speed-critical section.

 - Test for the new warning by importing a common non-package directory on
   sys.path: site-packages

 - In regrtest.py, silence warnings generated by the build-environment
   because Modules/ (which is added to sys.path for Setup-created modules)
   has 'zlib' and '_ctypes' directories without __init__.py's.
2006-04-27 23:13:20 +00:00