summaryrefslogtreecommitdiff
path: root/Lib/test/test_runpy.py
Commit message (Collapse)AuthorAgeFilesLines
* Issue #14285: Do not catch ImportError from __init__.py in runpyMartin Panter2015-12-031-0/+24
| | | | | | | | | | | | | Initialize package before calling get_loader() for __main__, so that we do not incorrectly handle ImportError from __init__.py. When runpy is used from the Python CLI, use an internal exception rather than ImportError, to avoid catching an unexpected ImportError. Also simplify message formatting: str() is redundant with %s. Also fix test_dash_m_error_code_is_one() in test_cmd_line_script, which was failing because the test package was not in the current directlry, rather the desired ValueError.
* #11420: make test suite pass with -B/DONTWRITEBYTECODE set. Initial patch ↵Ezio Melotti2013-03-161-17/+20
| | | | by Thomas Wouters.
* use assert[Not]In where appropriateEzio Melotti2010-01-231-10/+10
|
* Correctly escape arbitrary error message text in the runpy unit testsNick Coghlan2009-11-181-2/+2
|
* Allow for backslashes in file paths passed to the regex engineNick Coghlan2009-11-161-0/+2
|
* Issue #6816: expose the zipfile and directory execution mechanism to Python ↵Nick Coghlan2009-11-151-22/+142
| | | | code via the runpy module. Also consolidated some script execution functionality in the test harness into a helper module and removed some implementation details from the runpy module documentation.
* Add test for runpy.run_module package execution and use something other than ↵Nick Coghlan2009-11-071-5/+32
| | | | logging as the example of a non-executable package
* convert usage of fail* to assert*Benjamin Peterson2009-06-301-33/+33
|
* Implement PEP 366Nick Coghlan2007-12-031-7/+26
|
* Fix bug 1764407 - the -i switch now does the right thing when using the -m ↵Nick Coghlan2007-08-251-15/+13
| | | | switch
* Revert misguided attempt at fixing incompatibility between -m and -i ↵Nick Coghlan2007-08-251-29/+21
| | | | switches (better fix coming soon)
* Make test_runpy re-entrant.Brett Cannon2007-08-231-1/+2
|
* Fix an incompatibility between the -i and -m command line switches as ↵Nick Coghlan2007-07-241-21/+29
| | | | reported on python-dev by PJE - runpy.run_module now leaves any changes it makes to the sys module intact after the function terminates
* Tweak runpy test to do a better job of confirming that sys has been ↵Nick Coghlan2007-07-241-3/+5
| | | | manipulated correctly
* Correctly cleanup sys.modules after executing runpy relative importNick Coghlan2007-07-231-6/+6
| | | | | | tests Restore Python 2.4 ImportError when attempting to execute a package (as imports cannot be guaranteed to work properly if you try it)
* Add explicit relative import tests for runpy.run_moduleNick Coghlan2007-07-221-5/+66
|
* Revert the __module_name__ changes made in rev 47142. We'll revisit this in ↵Nick Coghlan2006-07-061-13/+5
| | | | Python 2.6
* Make full module name available as __module_name__ even when __name__ is set ↵Nick Coghlan2006-06-281-5/+13
| | | | to something else (like '__main__')
* Whitespace normalization.Tim Peters2006-03-151-3/+3
|
* Don't try to explicitly set path in runpy package tests (tests were broken ↵Nick Coghlan2006-03-151-1/+0
| | | | on Windows)
* Don't let cleanup errors mask real errors in the runpy testsNick Coghlan2006-03-151-5/+18
|
* Make test_runpy close all references to test modules before trying to delete ↵Nick Coghlan2006-03-151-8/+11
| | | | the underlying files
* Implement PEP 338 which has been marked as accepted by GvRNick Coghlan2006-03-151-0/+157