@@ -267,27 +267,26 @@ def validate_backend(s):
267267
268268
269269def validate_qt4 (s ):
270- # Don't spam the test suite with warnings every time the rcparams are
271- # reset. While it may seem better to use filterwarnings from within the
272- # test suite, pytest 3.1+ explicitly disregards warnings filters (pytest
273- # issue #2430).
274- if not testing .is_called_from_pytest ():
275- cbook .warn_deprecated (
276- "2.2" ,
277- "The backend.qt4 rcParam was deprecated in version 2.2. In order "
278- "to force the use of a specific Qt4 binding, either import that "
279- "binding first, or set the QT_API environment variable." )
270+ if s is None :
271+ # return a reasonable default for deprecation period
272+ return 'PyQt4'
273+ cbook .warn_deprecated (
274+ "2.2" ,
275+ "The backend.qt4 rcParam was deprecated in version 2.2. In order "
276+ "to force the use of a specific Qt4 binding, either import that "
277+ "binding first, or set the QT_API environment variable." )
280278 return ValidateInStrings ("backend.qt4" , ['PyQt4' , 'PySide' , 'PyQt4v2' ])(s )
281279
282280
283281def validate_qt5 (s ):
284- # See comment re: validate_qt4.
285- if not testing .is_called_from_pytest ():
286- cbook .warn_deprecated (
287- "2.2" ,
288- "The backend.qt5 rcParam was deprecated in version 2.2. In order "
289- "to force the use of a specific Qt5 binding, either import that "
290- "binding first, or set the QT_API environment variable." )
282+ if s is None :
283+ # return a reasonable default for deprecation period
284+ return 'PyQt5'
285+ cbook .warn_deprecated (
286+ "2.2" ,
287+ "The backend.qt5 rcParam was deprecated in version 2.2. In order "
288+ "to force the use of a specific Qt5 binding, either import that "
289+ "binding first, or set the QT_API environment variable." )
291290 return ValidateInStrings ("backend.qt5" , ['PyQt5' , 'PySide2' ])(s )
292291
293292
@@ -958,8 +957,8 @@ def _validate_linestyle(ls):
958957 'backend' : ['Agg' , validate_backend ], # agg is certainly
959958 # present
960959 'backend_fallback' : [True , validate_bool ], # agg is certainly present
961- 'backend.qt4' : ['PyQt4' , validate_qt4 ],
962- 'backend.qt5' : ['PyQt5' , validate_qt5 ],
960+ 'backend.qt4' : [None , validate_qt4 ],
961+ 'backend.qt5' : [None , validate_qt5 ],
963962 'webagg.port' : [8988 , validate_int ],
964963 'webagg.address' : ['127.0.0.1' , validate_webagg_address ],
965964 'webagg.open_in_browser' : [True , validate_bool ],
0 commit comments