Commit Graph

26 Commits

Author SHA1 Message Date
Éric Araujo 2180ee641c Fix code I unwittingly broke in b0e2d6592a1f (#14038) 2012-02-17 17:26:30 +01:00
Éric Araujo 1a765f5d9d Synchronize packaging.tests.support with distutils2 2012-02-09 21:30:25 +01:00
Ned Deily 61c4e10035 Issue #13901: Prevent test_packaging failures on OS X with --enable-shared. 2012-02-03 02:46:37 +01:00
Éric Araujo fad46e19b4 Clean up mocking of stdout and stdin in packaging tests.
Running with regrtest does not show spurious output or unrestored
sys.std* objects; sometimes running with make test is different, I’ll
watch the buildbots.

In addition, update the create module to use logging.
2011-11-06 11:32:47 +01:00
Éric Araujo a963e0d917 Undo potentially confusing name change in packaging.
This method was named reinitialize_command in distutils and accompanied
by a comment suggesting to change it to get_reinitialized_command.
Following that, I did the change for distutils2, but it proved
confusing: The Distribution object has an internal cache of command
objects, to make sure only one instance is ever used, and the name
get_reinitialized_command could suggest that the object returned was
independent of that cache, which it was not.  I’m reverting the name
change to make code clearer.
2011-11-06 06:54:05 +01:00
Éric Araujo 4e377f215d Make sure packaging tests that register custom commands also clear them 2011-11-06 07:01:18 +01:00
Éric Araujo 880801501b Improve byte-compilation in packaging to be independent of -O or -B.
The code I fixed to comply with PEP 3147 still had one bug: When run
under python -O, some paths for pyc files would be pyo, because I called
imp.cache_from_source without explicit debug_override argument in some
places, and under -O that would return .pyo (this is well explained in
the imp docs).  Now all code (util.byte_compile, build_py, install_lib)
can create .pyo files according to options given by users,
without interference from the calling Python’s own optimize mode.

On a related topic, I also removed the code that prevented byte
compilation under python -B.  The rationale is that packaging gives
control over the creation of pyc files to the user with its own explicit
option, and the behavior should not be changed if the calling Python
happens to run with -B for whatever reason.  I will argue that this is a
bug fix and ask to be allowed to backport this change to distutils.

Finally, I moved one nugget of information about the --compile and
--optimize options from the source into the doc.  It clears up a
misunderstanding that I (and maybe other people) had.
2011-11-03 05:08:28 +01:00
Éric Araujo 382067b3cf Change signature of packaging.tests.support.LoggingCatcher.get_logs.
I need this for some tests, and it makes code clearer.  This commit also
changes some assertEqual calls to use (actual, expected) order and fix
some pyflakes warnings.
2011-10-19 08:37:22 +02:00
Éric Araujo 8022314fc2 Cleanup in packaging: super considered super 2011-10-14 17:04:39 +02:00
Éric Araujo ae5af15e41 Minor: tweak docstrings and __all__ in packaging.tests.support 2011-09-01 23:48:13 +02:00
Éric Araujo e049f470cd Fix test_packaging on Windows (#12678).
See the distutils commit message for more detail.
2011-08-24 02:15:25 +02:00
Éric Araujo 0fe3605cac Try to fix packaging tests using build_ext on Windows (#12678) 2011-08-23 21:38:13 +02:00
Éric Araujo 2737222b49 Factor out the build_ext fixup for shared Python builds.
I need this to fix the failing test_command_install_dist.
2011-08-21 17:38:36 +02:00
Éric Araujo 60b0d31e35 Refactor the copying of xxmodule.c in packaging tests (#12141).
I need to copy this file in another test too, so I moved the support
code to distutils.tests.support and improved it to use proper skip
machinery instead of custom print/return/test suite fiddling.

Contrary to my similar change in distutils tests, I did not add support
for finding xxmodule.c when running a test from the tests directory,
because in that case my compiler didn’t find Python.h, so I figured it’s
better to skip than to fail.
2011-08-20 07:27:47 +02:00
Éric Araujo eb39294101 Silence 2to3 warnings in packaging tests 2011-07-15 17:49:20 +02:00
Victor Stinner 0f270b2c37 Issue #12333: close files before removing the directory
packaging.tests.support.TempdirManager: rmtree() fails on Windows if there are
still open files in the directory.
2011-06-17 13:25:53 +02:00
Victor Stinner ac6602bdc1 Issue #12333: restore the previous dir before removing the current directory
packaging.tests.support.TempdirManager: removing the current directory is not
allowed on Windows or Solaris. Store the current directory and restore it
before removing the temporary directory (which is used as the working directory
during the tests).
2011-06-17 12:20:46 +02:00
Éric Araujo 5d5bde1df2 Document autoflushing in packaging.test.support.LoggingCatcher.get_logs.
I’m afraid my docstring is not as clear as it should be, but I can’t
find a concise way of describing what the code does.  Suggestions for
improvements welcome.
2011-06-03 17:28:23 +02:00
Éric Araujo 78af7d8392 Make packaging.tests.support.LoggingCatcher.get_logs flush the log handler.
This removes the need to call flush manually in each test, except when
testing code that creates warning without checking them.
2011-06-02 14:53:59 +02:00
Tarek Ziade 5eb555990a Issue #12180: Fixed a few remaining errors in test_packaging when no threading. 2011-05-25 23:46:09 +02:00
Victor Stinner 79d1b1ce3f Issue #12167: packaging.tests.support, LoggingCatcher restores correctly the
log level. Avoid also calls to .addCleanup() in setUp().
2011-05-24 13:59:21 +02:00
Tarek Ziade 94449616da fixed a few mocking/cleanup issues in packaging test_util for win32 2011-05-21 10:37:58 +02:00
Ezio Melotti cad648cbc9 Skip tests that require zlib in the packaging tests. Also add a requires_zlib decorator to test.support. 2011-05-19 21:25:10 +03:00
Victor Stinner dd13dd4bcc Issue #12112: packaging reads and writes setup.cfg using UTF-8 2011-05-19 18:45:32 +02:00
Victor Stinner 21a9c748aa packaging: use with open() instead of try/finally: close 2011-05-19 15:51:27 +02:00
Tarek Ziade 1231a4e097 initial import of the packaging package in the standard library 2011-05-19 13:07:25 +02:00