SVN: zope.testing/trunk/src/zope/testing/doctest Show the deprecation warning at the spot where the module is imported.

Marius Gedminas <[email protected]>
Newsgroups gmane.comp.web.zope.zope3.cvs
Message-ID <[email protected]>
Log message for revision 106860:
  Show the deprecation warning at the spot where the module is imported.
  
  

Changed:
  U   zope.testing/trunk/src/zope/testing/doctest.py
  U   zope.testing/trunk/src/zope/testing/doctestunit.py

-=-
Modified: zope.testing/trunk/src/zope/testing/doctest.py
===================================================================
--- zope.testing/trunk/src/zope/testing/doctest.py	2009-12-22 09:16:42 UTC (rev 106859)
+++ zope.testing/trunk/src/zope/testing/doctest.py	2009-12-22 09:22:05 UTC (rev 106860)
@@ -107,7 +107,8 @@
 
 # Tell people to use the builtin module instead.
 warnings.warn('zope.testing.doctest is deprecated in favour of '
-              'the Python standard library doctest module', DeprecationWarning)
+              'the Python standard library doctest module', DeprecationWarning,
+               stacklevel=2)
 
 class UnusedFootnoteWarning(Warning):
     """Warn about a footnote that is defined, but never referenced."""

Modified: zope.testing/trunk/src/zope/testing/doctestunit.py
===================================================================
--- zope.testing/trunk/src/zope/testing/doctestunit.py	2009-12-22 09:16:42 UTC (rev 106859)
+++ zope.testing/trunk/src/zope/testing/doctestunit.py	2009-12-22 09:22:05 UTC (rev 106860)
@@ -21,7 +21,8 @@
 
 import warnings
 warnings.warn('zope.testing.doctestunit is deprecated in favour of '
-              'the Python standard library doctest module', DeprecationWarning)
+              'the Python standard library doctest module', DeprecationWarning,
+              stacklevel=2)
 
 from doctest import DocFileSuite, DocTestSuite
 from doctest import debug_src, debug
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.