Revision: 7729
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7729&view=rev
Author:   mdboom
Date:     2009-09-09 20:01:03 +0000 (Wed, 09 Sep 2009)

Log Message:
-----------
Some more work on creating a "clean" rcParams environment for running tests.

Modified Paths:
--------------
    trunk/matplotlib/lib/matplotlib/__init__.py
    trunk/matplotlib/lib/matplotlib/font_manager.py
    trunk/matplotlib/test/matplotlibrc

Modified: trunk/matplotlib/lib/matplotlib/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/__init__.py 2009-09-09 19:55:52 UTC (rev 
7728)
+++ trunk/matplotlib/lib/matplotlib/__init__.py 2009-09-09 20:01:03 UTC (rev 
7729)
@@ -894,16 +894,20 @@
     from testing.noseclasses import KnownFailure
     from nose.plugins.manager import PluginManager
 
+    # Store the current backend and all rcParams for restoration later
     backend = rcParams['backend']
+    original_params = rcParams.copy()
 
     use('Agg') # use Agg backend for these tests
 
-    # store the old values before overriding
-    overrides = 'font.family', 'text.hinting'
-    stored = dict([(k, rcParams[k]) for k in overrides])
-
+    # These settings *must* be hardcoded for running the comparison
+    # tests and are not necessarily the default values as specified in
+    # rcsetup.py
+    rcdefaults() # Start with all defaults
     rcParams['font.family'] = 'Bitstream Vera Sans'
     rcParams['text.hinting'] = False
+
+    # store the old values before overriding
     plugins = []
     plugins.append( KnownFailure() )
     plugins.extend( [plugin() for plugin in nose.plugins.builtin.plugins] )
@@ -914,11 +918,10 @@
     success = nose.run( defaultTest=default_test_modules,
                         config=config,
                         )
-    # restore the old rc values
-    rcParams.update(stored)
 
-    # restore the old backend
+    # restore the old backend and rcParams
     use(backend)
+    rcParams.update(original_params)
     return success
 
 test.__test__ = False # nose: this function is not a test

Modified: trunk/matplotlib/lib/matplotlib/font_manager.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/font_manager.py     2009-09-09 19:55:52 UTC 
(rev 7728)
+++ trunk/matplotlib/lib/matplotlib/font_manager.py     2009-09-09 20:01:03 UTC 
(rev 7729)
@@ -642,8 +642,7 @@
     The preferred usage of font sizes is to use the relative values,
     e.g.  'large', instead of absolute font sizes, e.g. 12.  This
     approach allows all text sizes to be made larger or smaller based
-    on the font manager's default font size, i.e. by using the
-    :meth:`FontManager.set_default_size` method.
+    on the font manager's default font size.
 
     This class will also accept a `fontconfig
     <http://www.fontconfig.org/>`_ pattern, if it is the only argument
@@ -1022,9 +1021,7 @@
         """
         Return the default font size.
         """
-        if self.default_size is None:
-            return rcParams['font.size']
-        return self.default_size
+        return rcParams['font.size']
 
     def set_default_weight(self, weight):
         """
@@ -1032,13 +1029,6 @@
         """
         self.__default_weight = weight
 
-    def set_default_size(self, size):
-        """
-        Set the default font size in points.  The initial value is set
-        by ``font.size`` in rc.
-        """
-        self.default_size = size
-
     def update_fonts(self, filenames):
         """
         Update the font dictionary with new font files.

Modified: trunk/matplotlib/test/matplotlibrc
===================================================================
--- trunk/matplotlib/test/matplotlibrc  2009-09-09 19:55:52 UTC (rev 7728)
+++ trunk/matplotlib/test/matplotlibrc  2009-09-09 20:01:03 UTC (rev 7729)
@@ -1,3 +1,3 @@
 backend      : Agg
-font.family         : sans-serif
-font.sans-serif     : Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, 
Lucid, Arial, Helvetica, Avant Garde, sans-serif
+font.family  : Bitstream Vera Sans
+text.hinting : True
\ No newline at end of file


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to