[docutils:bugs] #471 0.20 fails tests on pypy3
"Günter Milde" via Docutils-develop <[email protected]>
| Newsgroups | gmane.text.docutils.devel |
|---|---|
| Message-ID | </p/docutils/bugs/471/078b7cfeb8a44b7695301a920a4a7d8d48497f51.bugs@docutils.p.sourceforge.net> |
Thank you for the context info.
We could make the expected output more specific, e.g.
~~~
index 91c116b7e..fb743591f 100755
--- a/docutils/test/test_writers/test_latex2e.py
+++ b/docutils/test/test_writers/test_latex2e.py
@@ -24,7 +24,10 @@
DATA_ROOT = Path(__file__).resolve().parents[1] / 'data'
spam = os.path.relpath(DATA_ROOT/'spam').replace('\\', '/')
ham = os.path.relpath(DATA_ROOT/'ham.tex').replace('\\', '/')
-
+if False: # replace with something True when running under pypy
+ spampath = f"PosixPath('{spam})"
+else:
+ spampath = f"'{spam}.sty'"
class WriterPublishTestCase(unittest.TestCase):
@@ -1227,10 +1230,11 @@ def test_bibtex(self):
samples_stylesheet_embed['two-styles'] = [
["""two stylesheets embedded in the header""",
head_template.substitute(dict(parts,
-stylesheet=r"""% Cannot embed stylesheet:
-% [Errno 2] No such file or directory: '""" + spam + r""".sty'
-% embedded stylesheet: """ + ham + r"""
-\newcommand{\ham}{wonderful ham}
+stylesheet=f"""\
+% Cannot embed stylesheet:
+% [Errno 2] No such file or directory: {spampath}
+% embedded stylesheet: {ham}
+\\newcommand{{\\ham}}{{wonderful ham}}
""")) + r"""
two stylesheets embedded in the header
~~~
Do you know of a sensible statement to use as `something-only-true-when-running-under-pypy`?
---
**[bugs:#471] 0.20 fails tests on pypy3**
**Status:** open
**Created:** Wed May 10, 2023 02:53 AM UTC by Michał Górny
**Last Updated:** Wed May 10, 2023 03:45 PM UTC
**Owner:** nobody
When running the test suite of the 0.20 release on PyPy3, I get the following test failure:
```
Testing Docutils 0.20 with Python 3.9.16 on 2023-05-10 at 04:44:04
OS: Linux 6.2.14-gentoo-dist #1 SMP PREEMPT_DYNAMIC Mon May 1 15:03:02 -00 2023 (linux, Linux-6.2.14-gentoo-dist-x86_64-AMD_Ryzen_5_3600_6-Core_Processor-with-glibc2.37)
Working directory: /tmp/portage/dev-python/docutils-0.20/work/docutils-0.20/test
Docutils package: /tmp/portage/dev-python/docutils-0.20/work/docutils-0.20/docutils
.....................................................................s................................................................................................................................................................................................................s..............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................E.............................................
======================================================================
FAIL: test_embed_embed_stylesheet (test_writers.test_latex2e.WriterPublishTestCase) (id="samples_embed_stylesheet['two-styles'][0]")
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/portage/dev-python/docutils-0.20/work/docutils-0.20/test/test_writers/test_latex2e.py", line 151, in test_embed_embed_stylesheet
self.assertEqual(output, expected)
AssertionError: "\\do[452 chars]ory: PosixPath('data/spam.sty')\n% embedded st[439 chars]t}\n" != "\\do[452 chars]ory: 'data/spam.sty'\n% embedded stylesheet: d[428 chars]t}\n"
\documentclass[a4paper]{article}
% generated by Docutils <https://docutils.sourceforge.io/>
\usepackage{cmap} % fix search and cut-and-paste in Acrobat
\usepackage{ifthen}
\usepackage[T1]{fontenc}
%%% Custom LaTeX preamble
% PDF Standard Fonts
\usepackage{mathptmx} % Times
\usepackage[scaled=.90]{helvet}
\usepackage{courier}
%%% User specified packages and stylesheets
% Cannot embed stylesheet:
- % [Errno 2] No such file or directory: PosixPath('data/spam.sty')
? ---------- -
+ % [Errno 2] No such file or directory: 'data/spam.sty'
% embedded stylesheet: data/ham.tex
\newcommand{\ham}{wonderful ham}
%%% Fallback definitions for Docutils-specific commands
% hyperlinks:
\ifthenelse{\isundefined{\hypersetup}}{
\usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref}
\usepackage{bookmark}
\urlstyle{same} % normal text font (alternatives: tt, rm, sf)
}{}
%%% Body
\begin{document}
two stylesheets embedded in the header
\end{document}
----------------------------------------------------------------------
Ran 1636 tests in 14.868s
FAILED (failures=1, skipped=2)
Elapsed time: 15.745 seconds
```
---
Sent from sourceforge.net because [email protected] is subscribed to https://sourceforge.net/p/docutils/bugs/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.