Commit Graph

64 Commits

Author SHA1 Message Date
Zachary Ware 9fe6d86709 Issue 19572: More silently skipped tests explicitly skipped. 2013-12-08 00:20:35 -06:00
Brett Cannon a4975a911d Issue #18755: Allow imp.load_*() loaders to have get_data() called
multiple times.
2013-08-23 11:45:57 -04:00
Eric Snow 7491f1726b issue #18698: ensure importlib.reload() returns the module out of sys.modules. 2013-08-14 18:03:34 -06:00
Serhiy Storchaka b212291b08 Issue #18706: Fix a test for issue #18681 so it no longer breaks test_codeccallbacks*. 2013-08-11 20:12:20 +03:00
Ezio Melotti 056bafe7a6 #18681: Fix a NameError in imp.reload() (noticed by Weizhao Li). 2013-08-10 19:59:36 +03:00
Benjamin Peterson aa6f688bd4 only close non-None files 2013-05-11 16:29:03 -05:00
Brett Cannon dea2ec4b1d Fix a test to not use an assertion for something that could be
legitimately false.
2013-05-04 18:11:12 -04:00
Brett Cannon 9d0f772c51 Issue #15902: Fix imp.load_module() to accept None as a file when
trying to load an extension module.

While at it, also add a proper unittest.skipIf() guard to another test
involving imp.load_dynamic().
2013-05-03 10:37:08 -04:00
Ezio Melotti e5e7a7cbf4 #11420: merge with 3.2. 2013-03-16 21:49:20 +02:00
Ezio Melotti c28f6fa505 #11420: make test suite pass with -B/DONTWRITEBYTECODE set. Initial patch by Thomas Wouters. 2013-03-16 19:48:51 +02:00
Brett Cannon 848cdfdf97 Issue #15828: Don't try to close a file if imp.find_module() doesn't
return one.
2012-08-31 11:31:20 -04:00
Nick Coghlan 91b9f139bc Issue #15828: Restore support for C extension modules in imp.load_module() 2012-09-01 00:13:45 +10:00
Brett Cannon 19a2f5961c Issue #15056: imp.cache_from_source() and source_from_cache() raise
NotimplementedError when sys.implementation.cache_tag is None.

Thanks to Pranav Ravichandran for taking an initial stab at the patch.
2012-07-09 13:58:07 -04:00
Antoine Pitrou 06e37587ff Try to further debug occasional buildbot failure 2012-06-23 17:27:56 +02:00
Brett Cannon c049952de7 Issue #13959: Have
importlib.abc.FileLoader.load_module()/get_filename() and
importlib.machinery.ExtensionFileLoader.load_module() have their
single argument be optional as the loader's constructor has all the
ncessary information.

This allows for the deprecation of
imp.load_source()/load_compile()/load_package().
2012-05-11 14:48:41 -04:00
Brett Cannon 410e88d5fc Change tests for imp.cache_from_source() to follow os.path.join/split
semantics.
2012-04-22 13:29:47 -04:00
Brett Cannon f0434e647a Issue #14599: Generalize a test for ImportError.path and add support
in Python/dynload_shlibs.c.

This should fix the remaining importlib test failure on Windows.
Support in AIX and HP-UX will be in a separate checkin.
2012-04-20 15:22:50 -04:00
Brett Cannon dd9a56953e Issue #14633: Simplify imp.find_modue() test after fixes from issue
#14629 changed the message.
2012-04-20 12:59:59 -04:00
Antoine Pitrou 9a4d7ddb6c More debug output 2012-02-27 22:01:25 +01:00
Antoine Pitrou ffd85c8182 Improve debugging output for test failure 2012-02-27 20:04:05 +01:00
Antoine Pitrou 4f92a68a81 Issue #14080: fix sporadic test_imp failure. Patch by Stefan Krah. 2012-02-26 18:09:50 +01:00
Antoine Pitrou 658d1963e1 Additional debug info in case of failure 2012-02-22 02:46:58 +01:00
Antoine Pitrou 037615e1ef unload() should be sufficient 2012-02-22 02:30:09 +01:00
Antoine Pitrou abe72d7eb3 Try to debug sporadic test failures 2012-02-22 01:11:31 +01:00
Victor Stinner bf816223df Issue #12451: Add support.create_empty_file()
We don't need to create a temporary buffered binary or text file object just to
create an empty file.

Replace also os.fdopen(handle).close() by os.close(handle).
2011-06-30 23:25:47 +02:00
Antoine Pitrou d4a2ff40d5 Issue #11919: try to fix test_imp failure on some buildbots. 2011-04-25 21:46:04 +02:00
Antoine Pitrou 11846905d3 Issue #11919: try to fix test_imp failure on some buildbots. 2011-04-25 21:39:49 +02:00
Jesus Cea 88f7841be7 Correctly merging #9319 into 3.3? 2011-04-25 03:46:43 +02:00
Victor Stinner 7fdd0fe48f Issue #9319: Fix the unit test 2011-04-23 01:24:11 +02:00
Victor Stinner c68b6aaec8 Issue #9319: Fix a crash on parsing a Python source code without encoding
cookie and not valid in UTF-8: use "<file>" as the filename instead of
reading from NULL.
2011-04-23 00:41:19 +02:00
Victor Stinner fe7c5b5bdf Issue #9319: Include the filename in "Non-UTF8 code ..." syntax error. 2011-04-05 01:48:03 +02:00
Victor Stinner ccbf475dfd Fix imp.cache_from_source() if the directory name contains a dot
If the directory name contains a dot but not the filename, don't strip at the
dot.
2011-03-14 15:05:12 -04:00
Ezio Melotti b3aedd4862 #9424: Replace deprecated assert* methods in the Python test suite. 2010-11-20 19:04:17 +00:00
Brett Cannon 749afa95ce Move test_imp over to file context managers. 2010-10-29 23:47:23 +00:00
Alexander Belopolsky e8f583244a Issue #9308: Removed redundant coding cookies. Added tests for
importing encoded modules that do not depend on specific stdlib
modules being encoded in a certain way.
2010-10-15 16:28:20 +00:00
Victor Stinner 15d597a245 test_imp: getfilesystemencoding() cannot be None anymore
And the codec name is normalized.
2010-09-29 16:59:46 +00:00
Victor Stinner 09c449c7de Fix a typo: TESTFN_UNENCODEABLE => TESTFN_UNENCODABLE 2010-08-13 22:23:24 +00:00
Victor Stinner 1a4d12d746 Issue #9425: NullImporter constructor is fully unicode compliant
* On non-Windows OSes: the constructor accepts bytes filenames
   and use surrogateescape for unicode filenames
 * On Windows: use GetFileAttributesW() instead of GetFileAttributesA()
2010-08-13 13:07:29 +00:00
Benjamin Peterson 335d2c757d pydoc still has a silly encoding 2010-07-05 14:59:40 +00:00
Barry Warsaw 28a691b7fd PEP 3147 2010-04-17 00:19:56 +00:00
Florent Xicluna 97133720fc Typo 2010-03-20 20:31:34 +00:00
Florent Xicluna 21164ce8f1 #8133: Use appropriate Unicode decomposition on MacOS X platform. 2010-03-20 20:30:53 +00:00
Benjamin Peterson 25bfc55afe take into account shebang line change 2010-03-11 23:59:55 +00:00
Ezio Melotti 41a6b04b1f The test was failing because the curdir was missing from sys.path. This should fix the problem. 2010-03-06 01:50:25 +00:00
Ezio Melotti 435b531873 Cleanup and minor fixes. 2010-03-06 01:20:49 +00:00
Ezio Melotti 06dbff3b1f sys.getdefaultencoding() can return None. 2010-03-05 15:17:26 +00:00
Ezio Melotti 76e0d1a6ef r78689 enabled the test on more platforms but the buildbot did not like it. Using the filesystem encoding might work better. Also see #5604. 2010-03-05 15:08:19 +00:00
Ezio Melotti 9a7d5ac9f6 This fixes a missing .lower() on the encoding name, a wrong byte undecodable by UTF-8, a wrong variable name, hopefully some windows buildbot on 3.x and adds a proper skip. It might break other things though. 2010-03-05 12:43:17 +00:00
Nick Coghlan 6ead552b47 Note that a number of the changes listed below were not applicable to the Py3k branch, and hence the corresponding
files are unchanged in this checkin. This checkin is also the first time the environment checking in regrtest has
been forward ported to the Py3k branch.

This checkin causes test_xmlrpc to fail - see issue 7165 (it's a bug in the 3.x version of xmlrpc.server)
I am also getting a failure in test_telnetlib, but it isn't clear yet if that is due to these changes.

Recorded merge of revisions 75400-75401,75404,75406,75414,75416,75422,75425-75428,75435,75439,75441-75444,75447-75449,75451-75453,75455-75458,75460-75469,75471-75473,75475-75477,75479-75481,75483,75486-75489 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r75400 | r.david.murray | 2009-10-14 23:58:07 +1000 (Wed, 14 Oct 2009) | 6 lines

  Enhanced Issue 7058 patch, which will not be backported.  Refactors the
  code, adds checks for stdin/out/err, cwd, and sys.path, and adds a new
  section in the summary for tests that modify the environment (thanks to
  Ezio Melotti for that suggestion).
........
  r75453 | nick.coghlan | 2009-10-17 16:33:05 +1000 (Sat, 17 Oct 2009) | 1 line

  Correctly restore sys.stdout in test_descr
........
  r75456 | nick.coghlan | 2009-10-17 17:30:40 +1000 (Sat, 17 Oct 2009) | 1 line

  Enhancement to the new environment checking code to print the changed items under -vv. Also includes a small tweak to allow underscores in the names of resources.
........
  r75457 | nick.coghlan | 2009-10-17 17:34:27 +1000 (Sat, 17 Oct 2009) | 1 line

  Formatting tweak so that before and after values are vertically aligned
........
  r75458 | nick.coghlan | 2009-10-17 18:21:21 +1000 (Sat, 17 Oct 2009) | 1 line

  Check and revert expected sys.path alterations
........
  r75461 | nick.coghlan | 2009-10-18 00:40:54 +1000 (Sun, 18 Oct 2009) | 1 line

  Restore original sys.path when running TTK tests
........
  r75462 | nick.coghlan | 2009-10-18 01:09:41 +1000 (Sun, 18 Oct 2009) | 1 line

  Don't invoke reload(sys) and use StringIO objects instead of real files to capture stdin and stdout when needed (ensures all sys attributes remain unmodified after test_xmlrpc runs)
........
  r75463 | nick.coghlan | 2009-10-18 01:23:08 +1000 (Sun, 18 Oct 2009) | 1 line

  Revert changes made to environment in test_httpservers
........
  r75465 | nick.coghlan | 2009-10-18 01:45:52 +1000 (Sun, 18 Oct 2009) | 1 line

  Move restoration of the os.environ object into the context manager where it belongs
........
  r75466 | nick.coghlan | 2009-10-18 01:48:16 +1000 (Sun, 18 Oct 2009) | 1 line

  Also check and restore identity of sys.path, sys.argv and os.environ rather than just their values (this picked up a few more misbehaving tests)
........
  r75467 | nick.coghlan | 2009-10-18 01:57:42 +1000 (Sun, 18 Oct 2009) | 1 line

  Avoid replacing existing modules and sys.path in import tests
........
  r75468 | nick.coghlan | 2009-10-18 02:19:51 +1000 (Sun, 18 Oct 2009) | 1 line

  Don't replace sys.path in test_site
........
  r75481 | nick.coghlan | 2009-10-18 15:38:48 +1000 (Sun, 18 Oct 2009) | 1 line

  Using CleanImport to revert a reload of the os module doesn't work due to function registrations in copy_reg. The perils of reloading modules even for tests...
........
  r75486 | nick.coghlan | 2009-10-18 20:29:10 +1000 (Sun, 18 Oct 2009) | 1 line

  Silence a deprecation warning by using the appropriate replacement construct
........
  r75489 | nick.coghlan | 2009-10-18 20:56:21 +1000 (Sun, 18 Oct 2009) | 1 line

  Restore sys.path in test_tk
........
2009-10-18 13:19:33 +00:00
Benjamin Peterson c9c0f201fe convert old fail* assertions to assert* 2009-06-30 23:06:06 +00:00