SF.net SVN: docutils:[9638 ] trunk/docutils/test/test _dependencies.py

milde--- via Docutils-checkins <[email protected]>
Newsgroups gmane.text.docutils.cvs
Message-ID <[email protected]>
Revision: 9638
          http://sourceforge.net/p/docutils/code/9638
Author:   milde
Date:     2024-04-12 09:50:40 +0000 (Fri, 12 Apr 2024)
Log Message:
-----------
Fix test failure if tests are started from docutils/docutils.

The logic to determine if dependencies are accessible was faulty.

Modified Paths:
--------------
    trunk/docutils/test/test_dependencies.py

Modified: trunk/docutils/test/test_dependencies.py
===================================================================
--- trunk/docutils/test/test_dependencies.py	2024-04-11 23:03:24 UTC (rev 9637)
+++ trunk/docutils/test/test_dependencies.py	2024-04-12 09:50:40 UTC (rev 9638)
@@ -73,7 +73,7 @@
         # parsing even if not used in the chosen output format.
         # This should change (see parsers/rst/directives/misc.py).
         keys = ['include', 'raw']
-        if PIL and TEST_ROOT == CWD:
+        if PIL and os.path.exists('../docs/user/rst/images/'):
             keys += ['figure-image']
         expected = [paths[key] for key in keys]
         record, output = self.get_record(writer_name='xml')
@@ -82,7 +82,7 @@
 
     def test_dependencies_html(self):
         keys = ['include', 'raw']
-        if PIL and (TEST_ROOT == CWD):
+        if PIL and os.path.exists('../docs/user/rst/images/'):
             keys += ['figure-image', 'scaled-image']
         expected = [paths[key] for key in keys]
         # stylesheets are tested separately in test_stylesheet_dependencies():
@@ -101,7 +101,7 @@
         # parsing even if not used in the chosen output format.
         # This should change (see parsers/rst/directives/misc.py).
         keys = ['include', 'raw']
-        if PIL and TEST_ROOT == CWD:
+        if PIL and os.path.exists('../docs/user/rst/images/'):
             keys += ['figure-image']
         expected = [paths[key] for key in keys]
         record, output = self.get_record(

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
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.