pypa / readme_renderer

Safely render long_description/README files in Warehouse
Apache License 2.0
158 stars 88 forks source link

multiple test failures with v41 #302

Open nieder opened 4 months ago

nieder commented 4 months ago

This is macOS with python3.10. Unfortunately, it's for readme-renderer-v41 because I can't update to 42 which needs nh3, which needs rust, which I don't have.

/sw/bin/python3.10 -m pytest -vv || exit 2
========================================================================= test session starts =========================================================================
platform darwin -- Python 3.10.4, pytest-7.4.4, pluggy-1.3.0 -- /sw/bin/python3.10
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/.hypothesis/examples')
rootdir: /sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0
plugins: xprocess-0.23.0, icdiff-0.9, hypothesis-6.42.1, pyfakefs-5.3.4, cov-2.6.1, xdist-3.5.0, timeout-2.2.0
collected 49 items                                                                                                                                                    
Test results ``` _____________________________________________________________ test_cli_input_file[test_rst_003.rst-False] _____________________________________________________________ input_file = PosixPath('tests/fixtures/test_rst_003.rst'), output_file = False @pytest.mark.parametrize("output_file", [False, True]) def test_cli_input_file(input_file, output_file): with mock.patch("builtins.print") as print_: if output_file: with tempfile.TemporaryDirectory() as tmpdir: output = pathlib.Path(tmpdir) / "output.html" main(["-o", str(output), str(input_file)]) with output.open() as fp: result = fp.read() else: main([str(input_file)]) print_.assert_called_once() (result,), kwargs = print_.call_args with input_file.with_suffix(".html").open() as fp: expected = fp.read() > assert result.strip() == expected.strip() E assert equals failed E '
\n

Required packages

\n '
\n

Required packages

\n

To run th E

To run the PyPI software, you need Python 2.5+ and PostgreSQL

\n
\n\n\n
\n

Quick developmen ion id="quick-development-setup">\n

Quick development setup

\n

Mak E t setup\n

Make sure you are sitting

\n
' e sure you are sitting

\n' tests/test_cli.py:35: AssertionError _____________________________________________________________ test_cli_input_file[test_rst_003.rst-True] ______________________________________________________________ input_file = PosixPath('tests/fixtures/test_rst_003.rst'), output_file = True @pytest.mark.parametrize("output_file", [False, True]) def test_cli_input_file(input_file, output_file): with mock.patch("builtins.print") as print_: if output_file: with tempfile.TemporaryDirectory() as tmpdir: output = pathlib.Path(tmpdir) / "output.html" main(["-o", str(output), str(input_file)]) with output.open() as fp: result = fp.read() else: main([str(input_file)]) print_.assert_called_once() (result,), kwargs = print_.call_args with input_file.with_suffix(".html").open() as fp: expected = fp.read() > assert result.strip() == expected.strip() E assert equals failed E '
\n

Required packages

\n '
\n

Required packages

\n

To run th E

To run the PyPI software, you need Python 2.5+ and PostgreSQL

\n
\n\n\n
\n

Quick developmen ion id="quick-development-setup">\n

Quick development setup

\n

Mak E t setup\n

Make sure you are sitting

\n
' e sure you are sitting

\n' tests/test_cli.py:35: AssertionError _____________________________________________________________ test_cli_explicit_format[test_rst_003.rst] ______________________________________________________________ input_file = PosixPath('tests/fixtures/test_rst_003.rst') def test_cli_explicit_format(input_file): fmt = input_file.suffix.lstrip(".") with input_file.open() as fp, \ mock.patch("pathlib.Path.open", return_value=fp), \ mock.patch("builtins.print") as print_: main(["-f", fmt, "no-file.invalid"]) print_.assert_called_once() (result,), _ = print_.call_args with input_file.with_suffix(".html").open() as fp: > assert result.strip() == fp.read().strip() E assert equals failed E '
\n

Required packages

\n '
\n

Required packages

\n

To run th E

To run the PyPI software, you need Python 2.5+ and PostgreSQL

\n
\n\n\n
\n

Quick developmen ion id="quick-development-setup">\n

Quick development setup

\n

Mak E t setup\n

Make sure you are sitting

\n
' e sure you are sitting

\n' tests/test_cli.py:57: AssertionError ________________________________________ test_cli_package[docutils-Docutils is a modular system for processing documentation] _________________________________________ package = 'docutils', contains = 'Docutils is a modular system for processing documentation' @pytest.mark.parametrize("package, contains", [ ("readme_renderer", "Readme Renderer is a library that will safely render"), ("docutils", "Docutils is a modular system for processing documentation"), ]) def test_cli_package(package, contains): with mock.patch("builtins.print") as print_: > main(["-p", package]) tests/test_cli.py:66: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cli_args = ['-p', 'docutils'] def main(cli_args: Optional[List[str]] = None) -> None: parser = argparse.ArgumentParser( description="Renders a .md, .rst, or .txt README to HTML", ) parser.add_argument("-p", "--package", help="Get README from package metadata", action="store_true") parser.add_argument("-f", "--format", choices=["md", "rst", "txt"], help="README format (inferred from input file name or package)") parser.add_argument('input', help="Input README file or package name") parser.add_argument('-o', '--output', help="Output file (default: stdout)", type=argparse.FileType('w'), default='-') args = parser.parse_args(cli_args) content_format = args.format if args.package: message = metadata(args.input) source = message.get_payload() # type: ignore[attr-defined] # noqa: E501 https://peps.python.org/pep-0566/ # Infer the format of the description from package metadata. if not content_format: content_type = message.get("Description-Content-Type", "text/x-rst") # type: ignore[attr-defined] # noqa: E501 https://github.com/python/typeshed/issues/10021 if content_type == "text/x-rst": content_format = "rst" elif content_type == "text/markdown": content_format = "md" elif content_type == "text/plain": content_format = "txt" else: raise ValueError(f"invalid content type {content_type} for package " "`long_description`") else: filename = pathlib.Path(args.input) content_format = content_format or filename.suffix.lstrip(".") with filename.open() as fp: source = fp.read() if content_format == "md": rendered = render_md(source, stream=sys.stderr) elif content_format == "rst": rendered = render_rst(source, stream=sys.stderr) elif content_format == "txt": rendered = render_txt(source, stream=sys.stderr) else: raise ValueError(f"invalid README format: {content_format} (expected `md`, " "`rst`, or `txt`)") if rendered is None: > sys.exit(1) E SystemExit: 1 readme_renderer/__main__.py:57: SystemExit ------------------------------------------------------------------------ Captured stderr call ------------------------------------------------------------------------- No content rendered from RST source. _______________________________________________________________ test_rst_fixtures[test_rst_tables.rst] ________________________________________________________________ rst_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_tables.rst') html_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_tables.html') @pytest.mark.parametrize( ("rst_filename", "html_filename"), [ (pytest.param(fn, fn.with_suffix(".html"), id=fn.name)) for fn in Path(__file__).parent.glob("fixtures/test_*.rst") ], ) def test_rst_fixtures(rst_filename, html_filename): # Get our Markup with open(rst_filename, encoding='utf-8') as f: rst_markup = f.read() # Get our expected with open(html_filename, encoding="utf-8") as f: expected = f.read() out = render(rst_markup) if "<" in expected: > assert out == expected E assert equals failed E '\n\n\n\n\n\n\n\n\n\n\ ws optional)

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n

body row 2

\n\n\n\n\n\n\n\n\n\n >\n\n\n\n\n\n\n\n\n\n

Header row, column 1\n(header ro E >

Header row, column 1\n(header rows optional)

Header 2

Header 2

Header 3

Header 3

Header 4

Header 4

body row 1, column 1

column 2

body row 1, column 1

column 2

column p>

column 3

column 4

column 4

body row 2

Cells may span columns.

Cells may span columns.

b >\n

body row 3

Cells may\nspa E ody row 3

Cells may\nspan rows.

    \n
  • T E colspan="2" rowspan="2">

      \n
    • Table cells

    • \n< able cells

      \n
    • contain

    • \n
    • body elements.

    • contain

      \n
    • body elements.

    • \n
    \n

body row 4

body row 4

\n\n\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\ E >\n\n\n\n\n\n\n\n\n\n\n >singlerow

\n\n\n\n

title1

\n

title1

title2

col1

< E p>\n

title2

col2

mutirow

col1

col2

n

cell1

cell2

cell1

cell2

cell3

\n' E \n

singlerow

\n

cell3

\n\n\n\n' tests/test_rst.py:28: AssertionError ______________________________________________________________ test_rst_fixtures[test_rst_contents.rst] _______________________________________________________________ rst_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_contents.rst') html_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_contents.html') @pytest.mark.parametrize( ("rst_filename", "html_filename"), [ (pytest.param(fn, fn.with_suffix(".html"), id=fn.name)) for fn in Path(__file__).parent.glob("fixtures/test_*.rst") ], ) def test_rst_fixtures(rst_filename, html_filename): # Get our Markup with open(rst_filename, encoding='utf-8') as f: rst_markup = f.read() # Get our expected with open(html_filename, encoding="utf-8") as f: expected = f.read() out = render(rst_markup) if "<" in expected: > assert out == expected E assert equals failed E '
\n

C '

\n
Installation

\n\n\n
\n

Features

\n
\n
\n
  • Eats cheese

  • \n\n\n
    \n

    Installation\n

    Installation

    \n

    Requirements

    \n
      \n

      Requirements

      \n
        \n
      • Teeth

      • \n
      • Good taste

      • \n
      \ class="simple">\n
    • Teeth

    • \n
    • Good taste

    • \n
    \ E n

    Let’s eat some cheese together!

    \n
    \n' n

    Let’s eat some cheese together!

    \n\n' tests/test_rst.py:28: AssertionError _______________________________________________________________ test_rst_fixtures[test_rst_docinfo.rst] _______________________________________________________________ rst_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_docinfo.rst') html_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_docinfo.html') @pytest.mark.parametrize( ("rst_filename", "html_filename"), [ (pytest.param(fn, fn.with_suffix(".html"), id=fn.name)) for fn in Path(__file__).parent.glob("fixtures/test_*.rst") ], ) def test_rst_fixtures(rst_filename, html_filename): # Get our Markup with open(rst_filename, encoding='utf-8') as f: rst_markup = f.read() # Get our expected with open(html_filename, encoding="utf-8") as f: expected = f.read() out = render(rst_markup) if "<" in expected: > assert out == expected E assert equals failed E '
    \n
    Project
    \n
    \n
    Project

    pg_query – Pythonic wrapper around libpg_query

    \n\n
    :
    \n

    pg_query – Pythonic wrapper around E class="created">Created\n

    mer 02 ago 2017 14:49: libpg_query

    \n
    \n
    Created:\n\n
    Author
    \n

    L pan>\n

    mer 02 ago 2017 14:49:24 CEST

    \n
    \ E ele Gaifax <lele n
    Author:
    \n

    Lele Gaifax <License\n

    GNU General Public Licen ;it">lele@metapensiero.it>

    \n\n\n
    \n
    License:
    \n
    © 2017, 2018 Lele Gaifax
    \n
    \n

    GNU General Public License version 3 or later

    \n\n
    \n

    pg_query

    \n
    \n' class="copyright">Copyright:\n
    © 2017, 2018 Lele Gaifax
    \n\n
    \n

    pg_query

    \n
    \n' tests/test_rst.py:28: AssertionError _______________________________________________________________ test_rst_fixtures[test_rst_linkify.rst] _______________________________________________________________ rst_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_linkify.rst') html_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_linkify.html') @pytest.mark.parametrize( ("rst_filename", "html_filename"), [ (pytest.param(fn, fn.with_suffix(".html"), id=fn.name)) for fn in Path(__file__).parent.glob("fixtures/test_*.rst") ], ) def test_rst_fixtures(rst_filename, html_filename): # Get our Markup with open(rst_filename, encoding='utf-8') as f: rst_markup = f.read() # Get our expected with open(html_filename, encoding="utf-8") as f: expected = f.read() out = render(rst_markup) if "<" in expected: > assert out == expected E assert equals failed E 'https://travis-ci.org/tulsawebdevs/django-multi-gtfs.svg?bran  owhttps://travis-ci.org/tulsawebdevs/django-multi-gtfs.svg?bran 
E             ch=master\n\nhttps://coveralls.io/repos/github/tul  -multi-gtfshttps://coveralls.io/repos/github/tul 
E             sawebdevs/django-multi-gtfs/badge.svg?branch=django19\n

    multigtfs is an \n

    multigtfs is an Apache 2.0-licensed Django app tha com/licenses/apache/" rel="nofollow">Apache 2.0-licensed Django app tha E t supports importing\nand exporting of GTFS feeds. All features of the href="https://developers.google.com/transit/gtfs/reference" rel="nofollow"> E June 20, 2012 reference\nare supported, including all lopers.google.com/transit/gtfs/changes#RevisionHistory" rel="nofollow">all E changes up to February 17, 2014.\nIt allows multiple feeds to be stored changes up to February 17, 2014.\nIt allows multiple feeds to be stored E in the database at once.

    \n

    It requires a spatial databases compatibl in the database at once.

    \n

    It requires a spatial databases compatibl E e with GeoDjango. GeoDjango. PostgreSQL 9.x\nand PostgreSQL 9.x\nand PostGIS 2.x are recommended for development and production, si ofollow">PostGIS 2.x are recommended for development and production, si E nce these\nsupport all the GeoDjango features.

    \n
    \n
    \n E ="status">\n

    Status

    \n

    multigtfs is ready for your GTFS project.Status\n

    multigtfs is ready for your GTFS project.

    \n

    Point E p>\n

    Point releases (0.4.1 to 0.4.2) should be safe, only adding features releases (0.4.1 to 0.4.2) should be safe, only adding features or fixing\n E or fixing\nbugs. Minor updates (0.3.3 to 0.4.0) may include significant c bugs. Minor updates (0.3.3 to 0.4.0) may include significant changes that E hanges that will\nbreak relying code. In the worst case scenario, you may will\nbreak relying code. In the worst case scenario, you may need to expo E need to export your\nGTFS feeds in the original version, update multigtfs a rt your\nGTFS feeds in the original version, update multigtfs and your code E nd your code, and\nre-import.

    \n

    multigtfs works with Django 1.5 throu , and\nre-import.

    \n

    multigtfs works with Django 1.5 through 1.9. In t E gh 1.9. In the next version, support\nwill be limited to Django’s supported he next version, support\nwill be limited to Django’s supported releases, s E releases, so if you are using an old\nversion you will want to update to a o if you are using an old\nversion you will want to update to at least 1.8, E t least 1.8, the long-term support (LTS)\nrelease.

    \n

    All valid GTFS f the long-term support (LTS)\nrelease.

    \n

    All valid GTFS feeds are sup E eeds are supported for import and export. This includes\nfeeds with extra ported for import and export. This includes\nfeeds with extra columns not E columns not yet included in the GTFS spec, and feeds that\nomit calendar.txt in favor of calendar.txt in favor of cale E iteral">calendar_dates.txt (such as the TriMet\narchive feeds). If ndar_dates.txt (such as the TriMet\narchive feeds). If you find a f E you find a feed that doesn’t work, file a bug!

    \n

    See the < i-gtfs/issues" rel="nofollow">file a bug!

    \n

    See the issues list for more details on bugs and feature reque low">issues list for more details on bugs and feature requests.

    \n\n
    \n
    \n

    Example p section>\n
    \n

    Example project

    \n

    Chec E roject

    \n

    Check out the example proje E ollow">example project.

    \n
    \n
    \n

    Development

    \n E nt">\n

    Development

    \n
    \n
    Code
    \n
    \n
    Code:
    \n E

    https://github.com/tulsawebdevs/django-multi-gtfs

    \n
    \nhttps://github.com/tulsawebdevs/django-multi-gtfs

    \n\nIssues\n

    :\n

    https://github.com/tulsawebdevs/django-multi-g om/tulsawebdevs/django-multi-gtfs/issues" rel="nofollow">https://github.com E tfs/issues

    \n
    \n
    Dev Docs
    \n

    http://multigtfs.readthedocs.org/< ass="colon">:\n

    http://multigtfs.readthedocs.org/

    \n
    \n
    IRC E

    \n\n
    \n
    \n' :\n

    irc://irc.freenode.net/tulsawe E bdevs

    \n
    \n\n\n' tests/test_rst.py:28: AssertionError _______________________________________________________________ test_rst_fixtures[test_rst_bibtex.rst] ________________________________________________________________ rst_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_bibtex.rst') html_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_bibtex.html') @pytest.mark.parametrize( ("rst_filename", "html_filename"), [ (pytest.param(fn, fn.with_suffix(".html"), id=fn.name)) for fn in Path(__file__).parent.glob("fixtures/test_*.rst") ], ) def test_rst_fixtures(rst_filename, html_filename): # Get our Markup with open(rst_filename, encoding='utf-8') as f: rst_markup = f.read() # Get our expected with open(html_filename, encoding="utf-8") as f: expected = f.read() out = render(rst_markup) if "<" in expected: > assert out == expected E assert equals failed E '
    @article{@article{the_impact_of_pygments_docutils_config_and_html5the_impact_of_pygments_docutils_config_and_html5,\n  year,\n  year =  = {2 
    E              class="s">{2022},
    \n' 022},\n' tests/test_rst.py:28: AssertionError _______________________________________________________________ test_rst_fixtures[test_rst_caption.rst] _______________________________________________________________ rst_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_caption.rst') html_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_caption.html') @pytest.mark.parametrize( ("rst_filename", "html_filename"), [ (pytest.param(fn, fn.with_suffix(".html"), id=fn.name)) for fn in Path(__file__).parent.glob("fixtures/test_*.rst") ], ) def test_rst_fixtures(rst_filename, html_filename): # Get our Markup with open(rst_filename, encoding='utf-8') as f: rst_markup = f.read() # Get our expected with open(html_filename, encoding="utf-8") as f: expected = f.read() out = render(rst_markup) if "<" in expected: > assert out == expected E assert equals failed E '\n\n\n\n\n\n\n\n\n\n\n\n\n

    1

    \n\n\n\n\n\n\n E head">

    4

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n d>

    4

    \n\n\n\n E \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n< E 2

    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    MultiplicationMultiplication
    E >\n

    1

    2

    3

    2

    3

    4

    5

    5

    1

    2

    3

    \n

    1

    2

    3

    4\n

    4

    5

    2

    5

    2

    4

    6

    8

    10

    6

    8

    10

    3

    6

    9

    E

    3

    6

    9

    12

    15

    4

    8

    E d>

    15

    4

    8

    1

    12

    16

    20

    16

    20

    5

    tr>

    5

    10

    15

    20

    E

    10

    15

    20

    2

    25

    \n' E 5

    \n\n\n\n' tests/test_rst.py:28: AssertionError _______________________________________________________________ test_rst_fixtures[test_rst_figure.rst] ________________________________________________________________ rst_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_figure.rst') html_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_figure.html') @pytest.mark.parametrize( ("rst_filename", "html_filename"), [ (pytest.param(fn, fn.with_suffix(".html"), id=fn.name)) for fn in Path(__file__).parent.glob("fixtures/test_*.rst") ], ) def test_rst_fixtures(rst_filename, html_filename): # Get our Markup with open(rst_filename, encoding='utf-8') as f: rst_markup = f.read() # Get our expected with open(html_filename, encoding="utf-8") as f: expected = f.read() out = render(rst_markup) if "<" in expected: > assert out == expected E assert equals failed E '
    \nhttps://raw.githubusercontent  '<figure class=\nhttps://raw.githubusercontent.com 
E             .com/schlatterbeck/plot-antenna/master/test/12-el-azimuth.png\n

    This is the caption for the figure

    \n\n
    \n

    This is the caption for the figure

    \n\n' on>\n\n' tests/test_rst.py:28: AssertionError ______________________________________________________________ test_rst_fixtures[test_rst_citations.rst] ______________________________________________________________ rst_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_citations.rst') html_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_citations.html') @pytest.mark.parametrize( ("rst_filename", "html_filename"), [ (pytest.param(fn, fn.with_suffix(".html"), id=fn.name)) for fn in Path(__file__).parent.glob("fixtures/test_*.rst") ], ) def test_rst_fixtures(rst_filename, html_filename): # Get our Markup with open(rst_filename, encoding='utf-8') as f: rst_markup = f.read() # Get our expected with open(html_filename, encoding="utf-8") as f: expected = f.read() out = render(rst_markup) if "<" in expected: > assert out == expected E assert equals failed E '

    Citation references, like [C '

    Citation references, like .\nNote that citations may get\nrearranged, e.g., to the bottom rel="nofollow">[CIT2002].\nNote that citations may get\nrearranged, e.g E of\nthe “page”.

    \n
    \n
    ., to the bottom of\nthe “page”.

    \n
    \n[ E >\n

    A citation\n(as often used in journals).

    \n
    \n
    \n

    Ci CIT2002]\n

    A citation\n(as often used in journals). E ase is not significant.

    \n

    Given a citation like [this], one\ncan also refer to it like this.

    \n
    \n
    [this], E d="this">thisthis.

    E n>
    \n

    here.

    \n
    \n
    \n' \n
    \n
    \n[this]\n

    here.\n

    \n
    \n' tests/test_rst.py:28: AssertionError _____________________________________________________________ test_rst_fixtures[test_rst_admonitions.rst] _____________________________________________________________ rst_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_admonitions.rst') html_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_admonitions.html') @pytest.mark.parametrize( ("rst_filename", "html_filename"), [ (pytest.param(fn, fn.with_suffix(".html"), id=fn.name)) for fn in Path(__file__).parent.glob("fixtures/test_*.rst") ], ) def test_rst_fixtures(rst_filename, html_filename): # Get our Markup with open(rst_filename, encoding='utf-8') as f: rst_markup = f.read() # Get our expected with open(html_filename, encoding="utf-8") as f: expected = f.read() out = render(rst_markup) if "<" in expected: > assert out == expected E assert equals failed E '
    \n

    !DANGER!

    \ '
    \n
    \n

    \n

    Note

    \n

    F Sharp is a note, right?

    \n
    \n
    Note

    \n

    F Sharp is a note, right?

    \n\n E ss="admonition admonition-see-also">\n

    See also<

    \n' low">docutils

    \n\n' tests/test_rst.py:28: AssertionError _________________________________________________________________ test_rst_fixtures[test_rst_003.rst] _________________________________________________________________ rst_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_003.rst') html_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_003.html') @pytest.mark.parametrize( ("rst_filename", "html_filename"), [ (pytest.param(fn, fn.with_suffix(".html"), id=fn.name)) for fn in Path(__file__).parent.glob("fixtures/test_*.rst") ], ) def test_rst_fixtures(rst_filename, html_filename): # Get our Markup with open(rst_filename, encoding='utf-8') as f: rst_markup = f.read() # Get our expected with open(html_filename, encoding="utf-8") as f: expected = f.read() out = render(rst_markup) if "<" in expected: > assert out == expected E assert equals failed E '
    \n

    Required packages

    \n '
    \n

    Required packages

    \n

    To run th E

    To run the PyPI software, you need Python 2.5+ and PostgreSQL

    \n
    \n\n\n
    \n

    Quick developmen ion id="quick-development-setup">\n

    Quick development setup

    \n

    Mak E t setup\n

    Make sure you are sitting

    \n
    \n' e sure you are sitting

    \n\n' tests/test_rst.py:28: AssertionError _________________________________________________________________ test_rst_fixtures[test_rst_008.rst] _________________________________________________________________ rst_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_008.rst') html_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_008.html') @pytest.mark.parametrize( ("rst_filename", "html_filename"), [ (pytest.param(fn, fn.with_suffix(".html"), id=fn.name)) for fn in Path(__file__).parent.glob("fixtures/test_*.rst") ], ) def test_rst_fixtures(rst_filename, html_filename): # Get our Markup with open(rst_filename, encoding='utf-8') as f: rst_markup = f.read() # Get our expected with open(html_filename, encoding="utf-8") as f: expected = f.read() out = render(rst_markup) if "<" in expected: > assert out == expected E assert equals failed E None '

    Here is some Python code for a Dog:

    \n
    class Dog 
    E                                                                                          (Animal):\n    def __init__(self, name):\n        self.name = n 
    E                                                                                          ame\n\n    def make_sound(self):\n        print(\'Ruff!\')\n\ndog 
    E                                                                                           = Dog(\'Fido\')
    \n

    E and then here is some bash:

    \n
    if [ "$1" = < 
    E                                                                                          span class="s2">"--help" ]; then\n    echo "OK"\ 
    E                                                                                          nfi
    \n

    or click SurveyMonkey

    \n
    An u 
    E                                                                                          nknown code fence block
    \n' tests/test_rst.py:28: AssertionError ______________________________________________________________ test_rst_fixtures[test_rst_footnotes.rst] ______________________________________________________________ rst_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_footnotes.rst') html_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_footnotes.html') @pytest.mark.parametrize( ("rst_filename", "html_filename"), [ (pytest.param(fn, fn.with_suffix(".html"), id=fn.name)) for fn in Path(__file__).parent.glob("fixtures/test_*.rst") ], ) def test_rst_fixtures(rst_filename, html_filename): # Get our Markup with open(rst_filename, encoding='utf-8') as f: rst_markup = f.read() # Get our expected with open(html_filename, encoding="utf-8") as f: expected = f.read() out = render(rst_markup) if "<" in expected: > assert out == expected E assert equals failed E '

    Footnote references, like 5. '

    Footnote references, like [5\n

    ].\nNote that footnotes may get\nrearranged, e.g., to the bott E lass="brackets">5
    \n

    A n om of\nthe “page”.

    \n
    \n\n

    Autonumbered footnotes are\npossibl -bracket">[51 and ]\n

    A numerical footnote. Note\nthere’s E 6" id="id4" rel="nofollow">2.

    \n
    \n
    ].

    \n\ E class="label" id="id5">\n

    Autonumbered footnotes are\npossible, like using 2[1] and

    \n

    This is the second one.

    \n
    \n
    \n

    They may be d="footnote-reference-3" rel="nofollow">[2< E assigned ‘autonumber\nlabels’ - for instance,\n].

    \n
    miketheman commented 4 months ago

    We use tox as our test runner, which creates an isolated test environment. I can see from the output shown that there are unexpected plugins in that test environment that could be changing the behavior in unexpected ways.

    Here's what it looks like on macOS running 3.10 for the 41.0 release:

    ```shellsession $ git checkout 41.0 HEAD is now at 9c0f7d8 Release 41.0 (#292) $ tox -e py310 py310: install_deps> python -I -m pip install pytest pytest-cov .pkg: install_requires> python -I -m pip install 'setuptools>=40.8.0' .pkg: _optional_hooks> python /usr/local/Cellar/tox/4.13.0/libexec/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta .pkg: get_requires_for_build_sdist> python /usr/local/Cellar/tox/4.13.0/libexec/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta .pkg: get_requires_for_build_wheel> python /usr/local/Cellar/tox/4.13.0/libexec/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta .pkg: install_requires_for_build_wheel> python -I -m pip install wheel .pkg: prepare_metadata_for_build_wheel> python /usr/local/Cellar/tox/4.13.0/libexec/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta .pkg: build_sdist> python /usr/local/Cellar/tox/4.13.0/libexec/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta py310: install_package_deps> python -I -m pip install 'Pygments>=2.5.1' 'bleach>=2.1.0' 'cmarkgfm>=0.8.0' 'docutils>=0.13.1' py310: install_package> python -I -m pip install --force-reinstall --no-deps /Users/miketheman/workspace/miketheman/readme_renderer/.tox/.tmp/package/1/readme_renderer-41.0.tar.gz py310: commands[0]> pytest --strict-markers --cov ======================================================================================= test session starts ======================================================================================= platform darwin -- Python 3.10.13, pytest-8.0.2, pluggy-1.4.0 cachedir: .tox/py310/.pytest_cache rootdir: /Users/miketheman/workspace/miketheman/readme_renderer plugins: cov-4.1.0 collected 91 items tests/test_clean.py . [ 1%] tests/test_cli.py ............... [ 17%] tests/test_markdown.py ............................................ [ 65%] tests/test_noextra.py ss [ 68%] tests/test_rst.py ............................ [ 98%] tests/test_txt.py . [100%] --------- coverage: platform darwin, python 3.10.13-final-0 ---------- Name Stmts Miss Branch BrPart Cover --------------------------------------------------------------- readme_renderer/__init__.py 0 0 0 0 100% readme_renderer/__main__.py 44 7 22 4 77% readme_renderer/clean.py 39 3 20 1 93% readme_renderer/markdown.py 46 6 8 2 85% readme_renderer/rst.py 34 0 12 1 98% readme_renderer/txt.py 6 0 0 0 100% tests/__init__.py 0 0 0 0 100% tests/test_clean.py 3 0 0 0 100% tests/test_cli.py 46 0 22 0 100% tests/test_markdown.py 12 0 6 0 100% tests/test_noextra.py 9 4 2 0 45% tests/test_rst.py 39 0 8 0 100% tests/test_txt.py 11 0 6 0 100% --------------------------------------------------------------- TOTAL 289 20 106 8 91% ================================================================================== 89 passed, 2 skipped in 2.09s ================================================================================== .pkg: _exit> python /usr/local/Cellar/tox/4.13.0/libexec/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta py310: OK (23.28=setup[20.46]+cmd[2.83] seconds) congratulations :) (23.42 seconds) ```

    Mainly, note the difference in the plugins list at the top of the test run. In isolation, we should only see cov-4.1.0 but your run has a lot more than that, so I really cannot account for what's failing in your environment.

    Considering that nh3 also produces packaged wheels, I don't understand why you would need rust, unless you're not actually executing this in a macOS context, rather some other system isolation that isn't a platform that nh3 builds binaries for - but none of that is clear from your report.

    nieder commented 4 months ago

    Thanks for following up. I removed all plugins except pytest-cov and made sure to update pytest-cov and pluggy to match what your tox is installing. I even updated my python to the latest upstream. I also installed the optional dep cmarkgfm to make sure all tests were being excersised.

    tests output w/out plugins ``` /sw/bin/py.test-3.10 --strict-markers --cov || exit 2 ===================================================================== test session starts ====================================================================== platform darwin -- Python 3.10.13, pytest-7.4.4, pluggy-1.4.0 rootdir: /sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0 plugins: cov-4.1.0 collected 91 items tests/test_clean.py . [ 1%] tests/test_cli.py ..FF......F...F [ 17%] tests/test_markdown.py F....F.....................F....F........... [ 65%] tests/test_noextra.py ss [ 68%] tests/test_rst.py FFFF..FF..FFF..F.F.F........ [ 98%] tests/test_txt.py . [100%] =========================================================================== FAILURES =========================================================================== _________________________________________________________ test_cli_input_file[test_rst_003.rst-False] __________________________________________________________ input_file = PosixPath('tests/fixtures/test_rst_003.rst'), output_file = False @pytest.mark.parametrize("output_file", [False, True]) def test_cli_input_file(input_file, output_file): with mock.patch("builtins.print") as print_: if output_file: with tempfile.TemporaryDirectory() as tmpdir: output = pathlib.Path(tmpdir) / "output.html" main(["-o", str(output), str(input_file)]) with output.open() as fp: result = fp.read() else: main([str(input_file)]) print_.assert_called_once() (result,), kwargs = print_.call_args with input_file.with_suffix(".html").open() as fp: expected = fp.read() > assert result.strip() == expected.strip() E assert '
    E +
    E ? +++++++++++ + E

    Required packages

    E

    To run the PyPI software, you need Python 2.5+ and PostgreSQL

    E - E +
    ... E E ...Full output truncated (7 lines hidden), use '-vv' to show tests/test_cli.py:35: AssertionError __________________________________________________________ test_cli_input_file[test_rst_003.rst-True] __________________________________________________________ input_file = PosixPath('tests/fixtures/test_rst_003.rst'), output_file = True @pytest.mark.parametrize("output_file", [False, True]) def test_cli_input_file(input_file, output_file): with mock.patch("builtins.print") as print_: if output_file: with tempfile.TemporaryDirectory() as tmpdir: output = pathlib.Path(tmpdir) / "output.html" main(["-o", str(output), str(input_file)]) with output.open() as fp: result = fp.read() else: main([str(input_file)]) print_.assert_called_once() (result,), kwargs = print_.call_args with input_file.with_suffix(".html").open() as fp: expected = fp.read() > assert result.strip() == expected.strip() E assert '
    E +
    E ? +++++++++++ + E

    Required packages

    E

    To run the PyPI software, you need Python 2.5+ and PostgreSQL

    E - E +
    ... E E ...Full output truncated (7 lines hidden), use '-vv' to show tests/test_cli.py:35: AssertionError __________________________________________________________ test_cli_explicit_format[test_rst_003.rst] __________________________________________________________ input_file = PosixPath('tests/fixtures/test_rst_003.rst') def test_cli_explicit_format(input_file): fmt = input_file.suffix.lstrip(".") with input_file.open() as fp, \ mock.patch("pathlib.Path.open", return_value=fp), \ mock.patch("builtins.print") as print_: main(["-f", fmt, "no-file.invalid"]) print_.assert_called_once() (result,), _ = print_.call_args with input_file.with_suffix(".html").open() as fp: > assert result.strip() == fp.read().strip() E assert '
    E +
    E ? +++++++++++ + E

    Required packages

    E

    To run the PyPI software, you need Python 2.5+ and PostgreSQL

    E - E +
    ... E E ...Full output truncated (7 lines hidden), use '-vv' to show tests/test_cli.py:57: AssertionError _____________________________________ test_cli_package[docutils-Docutils is a modular system for processing documentation] _____________________________________ package = 'docutils', contains = 'Docutils is a modular system for processing documentation' @pytest.mark.parametrize("package, contains", [ ("readme_renderer", "Readme Renderer is a library that will safely render"), ("docutils", "Docutils is a modular system for processing documentation"), ]) def test_cli_package(package, contains): with mock.patch("builtins.print") as print_: > main(["-p", package]) tests/test_cli.py:66: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cli_args = ['-p', 'docutils'] def main(cli_args: Optional[List[str]] = None) -> None: parser = argparse.ArgumentParser( description="Renders a .md, .rst, or .txt README to HTML", ) parser.add_argument("-p", "--package", help="Get README from package metadata", action="store_true") parser.add_argument("-f", "--format", choices=["md", "rst", "txt"], help="README format (inferred from input file name or package)") parser.add_argument('input', help="Input README file or package name") parser.add_argument('-o', '--output', help="Output file (default: stdout)", type=argparse.FileType('w'), default='-') args = parser.parse_args(cli_args) content_format = args.format if args.package: message = metadata(args.input) source = message.get_payload() # type: ignore[attr-defined] # noqa: E501 https://peps.python.org/pep-0566/ # Infer the format of the description from package metadata. if not content_format: content_type = message.get("Description-Content-Type", "text/x-rst") # type: ignore[attr-defined] # noqa: E501 https://github.com/python/typeshed/issues/10021 if content_type == "text/x-rst": content_format = "rst" elif content_type == "text/markdown": content_format = "md" elif content_type == "text/plain": content_format = "txt" else: raise ValueError(f"invalid content type {content_type} for package " "`long_description`") else: filename = pathlib.Path(args.input) content_format = content_format or filename.suffix.lstrip(".") with filename.open() as fp: source = fp.read() if content_format == "md": rendered = render_md(source, stream=sys.stderr) elif content_format == "rst": rendered = render_rst(source, stream=sys.stderr) elif content_format == "txt": rendered = render_txt(source, stream=sys.stderr) else: raise ValueError(f"invalid README format: {content_format} (expected `md`, " "`rst`, or `txt`)") if rendered is None: > sys.exit(1) E SystemExit: 1 readme_renderer/__main__.py:57: SystemExit --------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------- No content rendered from RST source. __________________________________________________________ test_md_fixtures[test_GFM_doublequotes.md] __________________________________________________________ md_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_GFM_doublequotes.md') html_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_GFM_doublequotes.html'), variant = 'GFM' @pytest.mark.parametrize( ("md_filename", "html_filename", "variant"), [ (pytest.param(fn, fn.with_suffix(".html"), variant, id=fn.name)) for variant in variants for fn in Path(__file__).parent.glob(f"fixtures/test_{variant}*.md") ], ) def test_md_fixtures(md_filename, html_filename, variant): # Get our Markup with open(md_filename, encoding='utf-8') as f: md_markup = f.read() # Get our expected with open(html_filename, encoding="utf-8") as f: expected = f.read() > assert render(md_markup, variant=variant) == expected E assert '

    This is n...an>\n\n' == '

    This is n...an>\n\n' E Skipping 174 identical leading characters in diff, use -v to show E ): E - """This is a docstring.""" E ? --------------------------- E + """This is a docstring.""" E ? ++++ E pass... E E ...Full output truncated (11 lines hidden), use '-vv' to show tests/test_markdown.py:25: AssertionError _________________________________________________________ test_md_fixtures[test_GFM_malicious_pre.md] __________________________________________________________ md_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_GFM_malicious_pre.md') html_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_GFM_malicious_pre.html'), variant = 'GFM' @pytest.mark.parametrize( ("md_filename", "html_filename", "variant"), [ (pytest.param(fn, fn.with_suffix(".html"), variant, id=fn.name)) for variant in variants for fn in Path(__file__).parent.glob(f"fixtures/test_{variant}*.md") ], ) def test_md_fixtures(md_filename, html_filename, variant): # Get our Markup with open(md_filename, encoding='utf-8') as f: md_markup = f.read() # Get our expected with open(html_filename, encoding="utf-8") as f: expected = f.read() > assert render(md_markup, variant=variant) == expected E assert '

    This is n...an>\n\n' == '

    This is n...an>\n\n' E Skipping 130 identical leading characters in diff, use -v to show E ): E - """This is a docstring.""" E ? --------------------------- E + """This is a docstring.""" E ? ++++ E pass... E E ...Full output truncated (2 lines hidden), use '-vv' to show tests/test_markdown.py:25: AssertionError ___________________________________________________________ test_md_fixtures[test_GFM_highlight.md] ____________________________________________________________ md_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_GFM_highlight.md') html_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_GFM_highlight.html'), variant = 'GFM' @pytest.mark.parametrize( ("md_filename", "html_filename", "variant"), [ (pytest.param(fn, fn.with_suffix(".html"), variant, id=fn.name)) for variant in variants for fn in Path(__file__).parent.glob(f"fixtures/test_{variant}*.md") ], ) def test_md_fixtures(md_filename, html_filename, variant): # Get our Markup with open(md_filename, encoding='utf-8') as f: md_markup = f.read() # Get our expected with open(html_filename, encoding="utf-8") as f: expected = f.read() > assert render(md_markup, variant=variant) == expected E assert '

    This is n...ock\n\n' == '

    This is n...ock\n\n' E Skipping 338 identical leading characters in diff, use -v to show E - (){ E + (){ E + return E - return E ? ^ ^^^^ ^ ------ E + }... E E ...Full output truncated (5 lines hidden), use '-vv' to show tests/test_markdown.py:25: AssertionError ___________________________________________________________ test_md_fixtures[test_CommonMark_008.md] ___________________________________________________________ md_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_CommonMark_008.md') html_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_CommonMark_008.html'), variant = 'CommonMark' @pytest.mark.parametrize( ("md_filename", "html_filename", "variant"), [ (pytest.param(fn, fn.with_suffix(".html"), variant, id=fn.name)) for variant in variants for fn in Path(__file__).parent.glob(f"fixtures/test_{variant}*.md") ], ) def test_md_fixtures(md_filename, html_filename, variant): # Get our Markup with open(md_filename, encoding='utf-8') as f: md_markup = f.read() # Get our expected with open(html_filename, encoding="utf-8") as f: expected = f.read() > assert render(md_markup, variant=variant) == expected E assert '

    Here is s...key

    \n' == '

    Here is s...key

    \n' E Skipping 1054 identical leading characters in diff, use -v to show E - >if [ "$1" = "--help" ]; then E - echo "... E E ...Full output truncated (6 lines hidden), use '-vv' to show tests/test_markdown.py:25: AssertionError ____________________________________________________________ test_rst_fixtures[test_rst_tables.rst] ____________________________________________________________ rst_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_tables.rst') html_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_tables.html') @pytest.mark.parametrize( ("rst_filename", "html_filename"), [ (pytest.param(fn, fn.with_suffix(".html"), id=fn.name)) for fn in Path(__file__).parent.glob("fixtures/test_*.rst") ], ) def test_rst_fixtures(rst_filename, html_filename): # Get our Markup with open(rst_filename, encoding='utf-8') as f: rst_markup = f.read() # Get our expected with open(html_filename, encoding="utf-8") as f: expected = f.read() out = render(rst_markup) if "<" in expected: > assert out == expected E AssertionError: assert '\n\n
    \n' == '\n\n
    \n' E E + E + E + E + E + E + ... E E ...Full output truncated (55 lines hidden), use '-vv' to show tests/test_rst.py:28: AssertionError ___________________________________________________________ test_rst_fixtures[test_rst_contents.rst] ___________________________________________________________ rst_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_contents.rst') html_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_contents.html') @pytest.mark.parametrize( ("rst_filename", "html_filename"), [ (pytest.param(fn, fn.with_suffix(".html"), id=fn.name)) for fn in Path(__file__).parent.glob("fixtures/test_*.rst") ], ) def test_rst_fixtures(rst_filename, html_filename): # Get our Markup with open(rst_filename, encoding='utf-8') as f: rst_markup = f.read() # Get our expected with open(html_filename, encoding="utf-8") as f: expected = f.read() out = render(rst_markup) if "<" in expected: > assert out == expected E assert '
    \n' E -
    \n\n
    \n' == '\n\n
    \n' E Skipping 33 identical leading characters in diff, use -v to show E caption> E + E + E + E + E + ... E E ...Full output truncated (43 lines hidden), use '-vv' to show tests/test_rst.py:28: AssertionError ____________________________________________________________ test_rst_fixtures[test_rst_figure.rst] ____________________________________________________________ rst_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_figure.rst') html_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_figure.html') @pytest.mark.parametrize( ("rst_filename", "html_filename"), [ (pytest.param(fn, fn.with_suffix(".html"), id=fn.name)) for fn in Path(__file__).parent.glob("fixtures/test_*.rst") ], ) def test_rst_fixtures(rst_filename, html_filename): # Get our Markup with open(rst_filename, encoding='utf-8') as f: rst_markup = f.read() # Get our expected with open(html_filename, encoding="utf-8") as f: expected = f.read() out = render(rst_markup) if "<" in expected: > assert out == expected E assert '
    E ? ^ ^^^^ E +
    E ? ^ ^ +++++++ E https://raw.githubusercontent.com/schlatterbeck/plot-antenna/master/test/12-el-azimuth.png E +

    This is the caption for the figure

    E +
    ... E E ...Full output truncated (4 lines hidden), use '-vv' to show tests/test_rst.py:28: AssertionError __________________________________________________________ test_rst_fixtures[test_rst_citations.rst] ___________________________________________________________ rst_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_citations.rst') html_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_citations.html') @pytest.mark.parametrize( ("rst_filename", "html_filename"), [ (pytest.param(fn, fn.with_suffix(".html"), id=fn.name)) for fn in Path(__file__).parent.glob("fixtures/test_*.rst") ], ) def test_rst_fixtures(rst_filename, html_filename): # Get our Markup with open(rst_filename, encoding='utf-8') as f: rst_markup = f.read() # Get our expected with open(html_filename, encoding="utf-8") as f: expected = f.read() out = render(rst_markup) if "<" in expected: > assert out == expected E assert '

    Citation .../dd>\n\n' == '

    Citation ...iv>\n

    \n' E Skipping 42 identical leading characters in diff, use -v to show E - 2002" id="citation-reference-1" rel="nofollow">[CIT2002]
    . E ? - ^^^^^^^^^^^^^^^^^ E + 2002" id="id1" rel="nofollow">[CIT2002]. E ? ^ E Note that citations may get E rearranged, e.g., to the bottom of... E E ...Full output truncated (46 lines hidden), use '-vv' to show tests/test_rst.py:28: AssertionError _________________________________________________________ test_rst_fixtures[test_rst_admonitions.rst] __________________________________________________________ rst_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_admonitions.rst') html_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_admonitions.html') @pytest.mark.parametrize( ("rst_filename", "html_filename"), [ (pytest.param(fn, fn.with_suffix(".html"), id=fn.name)) for fn in Path(__file__).parent.glob("fixtures/test_*.rst") ], ) def test_rst_fixtures(rst_filename, html_filename): # Get our Markup with open(rst_filename, encoding='utf-8') as f: rst_markup = f.read() # Get our expected with open(html_filename, encoding="utf-8") as f: expected = f.read() out = render(rst_markup) if "<" in expected: > assert out == expected E assert '
    E ? ^^ ^^ E +
    E ? ^ ^ E

    !DANGER!

    E

    Will Robinson

    E - ... E E ...Full output truncated (18 lines hidden), use '-vv' to show tests/test_rst.py:28: AssertionError _____________________________________________________________ test_rst_fixtures[test_rst_003.rst] ______________________________________________________________ rst_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_003.rst') html_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_003.html') @pytest.mark.parametrize( ("rst_filename", "html_filename"), [ (pytest.param(fn, fn.with_suffix(".html"), id=fn.name)) for fn in Path(__file__).parent.glob("fixtures/test_*.rst") ], ) def test_rst_fixtures(rst_filename, html_filename): # Get our Markup with open(rst_filename, encoding='utf-8') as f: rst_markup = f.read() # Get our expected with open(html_filename, encoding="utf-8") as f: expected = f.read() out = render(rst_markup) if "<" in expected: > assert out == expected E assert '
    E +
    E ? +++++++++++ + E

    Required packages

    E

    To run the PyPI software, you need Python 2.5+ and PostgreSQL

    E - E +
    ... E E ...Full output truncated (7 lines hidden), use '-vv' to show tests/test_rst.py:28: AssertionError _____________________________________________________________ test_rst_fixtures[test_rst_008.rst] ______________________________________________________________ rst_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_008.rst') html_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_008.html') @pytest.mark.parametrize( ("rst_filename", "html_filename"), [ (pytest.param(fn, fn.with_suffix(".html"), id=fn.name)) for fn in Path(__file__).parent.glob("fixtures/test_*.rst") ], ) def test_rst_fixtures(rst_filename, html_filename): # Get our Markup with open(rst_filename, encoding='utf-8') as f: rst_markup = f.read() # Get our expected with open(html_filename, encoding="utf-8") as f: expected = f.read() out = render(rst_markup) if "<" in expected: > assert out == expected E assert None == '

    Here is some Python code for a Dog:

    \n
    classSurveyMonkey

    \n
    An unknown code fence block
    \n' tests/test_rst.py:28: AssertionError __________________________________________________________ test_rst_fixtures[test_rst_footnotes.rst] ___________________________________________________________ rst_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_footnotes.rst') html_filename = PosixPath('/sw/build.build/readme-renderer-py310-41.0-1/readme_renderer-41.0/tests/fixtures/test_rst_footnotes.html') @pytest.mark.parametrize( ("rst_filename", "html_filename"), [ (pytest.param(fn, fn.with_suffix(".html"), id=fn.name)) for fn in Path(__file__).parent.glob("fixtures/test_*.rst") ], ) def test_rst_fixtures(rst_filename, html_filename): # Get our Markup with open(rst_filename, encoding='utf-8') as f: rst_markup = f.read() # Get our expected with open(html_filename, encoding="utf-8") as f: expected = f.read() out = render(rst_markup) if "<" in expected: > assert out == expected E assert '

    Footnote .../dd>\n\n' == '

    Footnote ...>\n\n' E -

    Footnote references, like [5]. E +

    Footnote references, like 5. E Note that footnotes may get E rearranged, e.g., to the bottom of E the “page”.

    E -
    \n' == '
    \n
    \n' == '\n
    \n' == '
    \n' FAILED tests/test_rst.py::test_rst_fixtures[test_rst_citations.rst] - assert '

    Citation .../dd>\n\n' == '

    Citation ...iv>\n

    \n' FAILED tests/test_rst.py::test_rst_fixtures[test_rst_admonitions.rst] - assert '
    \n
    \n' == '
    \n' FAILED tests/test_rst.py::test_rst_fixtures[test_rst_008.rst] - assert None == '

    Here is some Python code for a Dog:

    \n
    classFootnote .../dd>\n\n' == '

    Footnote ...>\n\n' ==================================================== 20 failed, 69 passed, 2 skipped, 58 warnings in 3.09s ===================================================== ```

    This is in the context of Fink, a package manager. I can't use the compiled nh3 wheels because policy is to not use vendor binaries (MacPorts also has the same policy, don't know about homebrew). We also avoid testing with tox because it has network access during the build to download many deps (most of which already exist in the build system), which is also against policy (as with many other Linux distributions). So that's why I'm running the tests directly rather than through a test runner.

    nieder commented 4 months ago

    This actually led me to make a minimal install with no other python mods installed. I then ran tox -e py310 outside our build system (all tests passed) and saved the .tox directory. I then ran the tests manually using the .tox directory with PYTHONPATH and the tests passed. So the problem is not about not running through tox itself, but something else missing. Comparing the system-site-packages and tox-site-packages the biggest differences are pygments and docutils, even though both of my local installs of those pass the required version minimums in setup.py. I'll need to start digging into matching install versions as much as possible to see if that does it.