@@ -276,8 +276,9 @@ def test_filter_module(self):
276276 with self .assertRaises (UserWarning ):
277277 self .module .warn_explicit ('msg' , UserWarning , '/PATH/TO/PACKAGE/MODULE' , 42 )
278278 if MS_WINDOWS :
279- self .module .warn_explicit ('msg' , UserWarning , r'/path/to/package/module.PY' , 42 )
280- self .assertEqual (len (w ), 3 )
279+ if self .module is py_warnings :
280+ self .module .warn_explicit ('msg' , UserWarning , r'/path/to/package/module.PY' , 42 )
281+ self .assertEqual (len (w ), 3 )
281282 with self .assertRaises (UserWarning ):
282283 self .module .warn_explicit ('msg' , UserWarning , r'/path/to/package/module/__init__.py' , 42 )
283284 with self .assertRaises (UserWarning ):
@@ -301,8 +302,9 @@ def test_filter_module(self):
301302 self .assertEqual (len (w ), 1 )
302303 self .module .warn_explicit ('msg' , UserWarning , r'C:\path\to\package\module.py' , 42 )
303304 self .assertEqual (len (w ), 2 )
304- self .module .warn_explicit ('msg' , UserWarning , r'C:\path\to\package\module.PY' , 42 )
305- self .assertEqual (len (w ), 3 )
305+ if self .module is py_warnings :
306+ self .module .warn_explicit ('msg' , UserWarning , r'C:\path\to\package\module.PY' , 42 )
307+ self .assertEqual (len (w ), 3 )
306308 with self .assertRaises (UserWarning ):
307309 self .module .warn_explicit ('msg' , UserWarning , r'C:\path\to\package\module.pyw' , 42 )
308310 with self .assertRaises (UserWarning ):
0 commit comments