Looks like with new version pytest is failing in few units.
Reproduce the bug
I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
python3 -sBm build -w --no-isolation
because I'm calling build with --no-isolation I'm using during all processes only locally installed modules
install .whl file in </install/prefix> using 'installer` module
run pytest with $PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>
build is performed in env which is cut off from access to the public network (pytest is executed with -m "not network")
_ test_fixtures[237-Indented by 4 spaces, DISABLE-CODEBLOCKS- \\begin{equation}\n a = 1\n \\end{equation}\n-
\n\\begin{equation}\n a = 1\n \\end{equation}\n
\n] _
line = 237, title = 'Indented by 4 spaces, DISABLE-CODEBLOCKS', input = ' \\begin{equation}\n a = 1\n \\end{equation}\n'
expected = '
\n\\begin{equation}\n a = 1\n \\end{equation}\n
\n'
@pytest.mark.parametrize(
"line,title,input,expected",
read_fixture_file(FIXTURE_PATH.joinpath("fixtures", "amsmath.md")),
)
def test_fixtures(line, title, input, expected):
md = MarkdownIt("commonmark").use(amsmath_plugin)
if "DISABLE-CODEBLOCKS" in title:
md.disable("code")
md.options["xhtmlOut"] = False
text = md.render(input)
print(text)
> assert text.rstrip() == expected.rstrip()
E assert '
\\begin{e...equation}
' == '
E - \begin{equation}
E +
\begin{equation}
E ? +++
E - a = 1
E ? ----
E + a = 1...
E
E ...Full output truncated (5 lines hidden), use '-vv' to show
tests/test_amsmath.py:58: AssertionError
----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------
______________________ test_all[261-Indented by 4 spaces, DISABLE-CODEBLOCKS- Term 1\n\n : Definition 1\n-
\n
Term 1
\n
Definition 1
\n
\n] ______________________
line = 261, title = 'Indented by 4 spaces, DISABLE-CODEBLOCKS', input = ' Term 1\n\n : Definition 1\n', expected = '
\n
Term 1
\n
Definition 1
\n
\n'
@pytest.mark.parametrize("line,title,input,expected", read_fixture_file(FIXTURE_PATH))
def test_all(line, title, input, expected):
md = MarkdownIt("commonmark").use(deflist_plugin)
if "DISABLE-CODEBLOCKS" in title:
md.disable("code")
md.options["xhtmlOut"] = False
text = md.render(input)
print(text)
> assert text.rstrip() == expected.rstrip()
E AssertionError: assert '
Term 1' == '
\n
Te...1\n
'
E -
E -
Term 1
E ? ^^ ^^
E +
Term 1
E ? ^ ^
E -
Definition 1
E ? ^^ ^^ -...
E
E ...Full output truncated (3 lines hidden), use '-vv' to show
tests/test_deflist.py:39: AssertionError
----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------
Term 1
: Definition 1
_________________________________ test_dollarmath_fixtures[575-Indented by 4 spaces, DISABLE-CODEBLOCKS- $$a$$\n-
\na\n
\n] __________________________________
line = 575, title = 'Indented by 4 spaces, DISABLE-CODEBLOCKS', input = ' $$a$$\n', expected = '
\na\n
\n'
@pytest.mark.parametrize(
"line,title,input,expected",
read_fixture_file(FIXTURE_PATH.joinpath("dollar_math.md")),
)
def test_dollarmath_fixtures(line, title, input, expected):
md = MarkdownIt("commonmark").use(
dollarmath_plugin,
allow_space=False,
allow_digits=False,
double_inline=True,
allow_blank_lines=False,
)
if "DISABLE-CODEBLOCKS" in title:
md.disable("code")
md.options.xhtmlOut = False
text = md.render(input)
print(text)
> assert text.rstrip() == expected.rstrip()
E assert '
__________________________________________________________________ test_all[378-Indented_by_4_spaces,_DISABLE-CODEBLOCKS] ___________________________________________________________________
line = 378, title = 'Indented by 4 spaces, DISABLE-CODEBLOCKS', input = ' :name: text\n indented\n'
expected = '
\n
name
\n
\n
text\nindented
\n
\n
\n'
@pytest.mark.parametrize(
"line,title,input,expected",
fixtures,
ids=[f"{f[0]}-{f[1].replace(' ', '_')}" for f in fixtures],
)
def test_all(line, title, input, expected):
md = MarkdownIt("commonmark").use(fieldlist_plugin)
if "DISABLE-CODEBLOCKS" in title:
md.disable("code")
md.options["xhtmlOut"] = False
text = md.render(input)
print(text)
> assert text.rstrip() == expected.rstrip()
E assert '
:name: text\nindented
' == '
E -
name
E -
E -
text
E - indented
E ? -...
E
E ...Full output truncated (3 lines hidden), use '-vv' to show
tests/test_field_list.py:41: AssertionError
----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------
:name: text
indented
_ test_all[360-Indented by 4 spaces, DISABLE-CODEBLOCKS- [^1]\n\n [^1]: footnote\n-
...
E
E ...Full output truncated (3 lines hidden), use '-vv' to show
tests/test_footnote.py:459: AssertionError
----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------
[^1]
[^1]: footnote
___ test_all[168-Indented by 4 spaces, DISABLE-CODEBLOCKS- +++\n\n % abc\n\n (a)=\n-\n
================================================================================== short test summary info ==================================================================================
FAILED tests/test_admon.py::test_all[306-Indented by 4 spaces, DISABLE-CODEBLOCKS- ??? note\n content\n-
\n
Note
\n
content
\n
\n] - assert '
??? note\ncontent
' == '
\n\\begin{equation}\n a = 1\n \\end{equation}\n
\n] - assert '
\\begin{e...equation}
' == '
head\n] - assert '
{#a .a b=c}\n# head
' == '
head
'
FAILED tests/test_colon_fence.py::test_fixtures[438-Indented by 4 spaces, DISABLE-CODEBLOCKS- :::name\n foo\n :::\n-
This package is written and distributed for users, not packagers.
If you do not want to package it because of the limitations I would understand and encourage you not to
But look this is not a debate, I'm just doing you the courtesy of letting you know the priority for this repository and in fact for every python package I author/maintain (and has always been).
This is open source software, free, there is no obligation on my part to do anything;
if this is not to your taste, you are absolutely welcome to not use it, or to fork it, the choice is yours
Please try to look on those data closer.
Most of the downloads are for python version no longer supported by and/or any latest version of any Linux/BSD/Solaris/Win distributions.
Those people have no choice ..
Describe the bug
Looks like with new version pytest is failing in few units.
Reproduce the bug
I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
python3 -sBm build -w --no-isolation
build
with--no-isolation
I'm using during all processes only locally installed modulescut off from access to the public network
(pytest is executed with-m "not network"
)Here is pytest output:
Note
\ncontent
\nNote
\ncontent
\n??? note\ncontent
' == 'Note
E -content
E ? --- - E + content E -??? note content
_ test_fixtures[237-Indented by 4 spaces, DISABLE-CODEBLOCKS- \\begin{equation}\n a = 1\n \\end{equation}\n-\\begin{e...equation}
' == '\begin{equation} E ? +++ E - a = 1 E ? ---- E + a = 1... E E ...Full output truncated (5 lines hidden), use '-vv' to show tests/test_amsmath.py:58: AssertionError ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------
\begin{equation} a = 1 \end{equation}
_______________________________ test_attrs[254-Indented by 4 spaces, DISABLE-CODEBLOCKS- {#a .a b=c}\n # head\n-head
\n] _______________________________ line = 254, title = 'Indented by 4 spaces, DISABLE-CODEBLOCKS', input = ' {#a .a b=c}\n # head\n', expected = 'head
\n' @pytest.mark.parametrize( "line,title,input,expected", read_fixture_file(FIXTURE_PATH / "attrs.md") ) def test_attrs(line, title, input, expected): md = MarkdownIt("commonmark").use(attrs_plugin, spans=True).use(attrs_block_plugin) if "DISABLE-CODEBLOCKS" in title: md.disable("code") md.options["xhtmlOut"] = False text = md.render(input) print(text) > assert text.rstrip() == expected.rstrip() E assert '{#a .a b=c}\n# head
' == 'head
' E -head
E +{#a .a b=c} E + # head
tests/test_attrs.py:22: AssertionError ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------{#a .a b=c} # head
______________________ test_fixtures[438-Indented by 4 spaces, DISABLE-CODEBLOCKS- :::name\n foo\n :::\n- \n] ______________________ line = 438, title = 'Indented by 4 spaces, DISABLE-CODEBLOCKS', input = ' :::name\n foo\n :::\n', expected = ' \n' @pytest.mark.parametrize("line,title,input,expected", read_fixture_file(FIXTURE_PATH)) def test_fixtures(line, title, input, expected): md = MarkdownIt("commonmark").use(colon_fence_plugin) if "DISABLE-CODEBLOCKS" in title: md.disable("code") md.options["xhtmlOut"] = False text = md.render(input) try: > assert text.rstrip() == expected.rstrip() E assert ':::name\nfoo\n:::
' == ' ' E - E +:::name E + foo E + :::
tests/test_colon_fence.py:21: AssertionError ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------:::name foo :::
_________________________ test_all[301-Indented by 4 spaces, DISABLE-CODEBLOCKS- ::: name\n content\n :::\n-content
\ncontent
\n::: name\...tent\n:::
' == 'content
E -::: name E + content E + :::
tests/test_container.py:50: AssertionError ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------::: name content :::
______________________ test_all[261-Indented by 4 spaces, DISABLE-CODEBLOCKS- Term 1\n\n : Definition 1\n-\n- Term 1
\n- Definition 1
\n
\n] ______________________ line = 261, title = 'Indented by 4 spaces, DISABLE-CODEBLOCKS', input = ' Term 1\n\n : Definition 1\n', expected = '\n- Term 1
\n- Definition 1
\n
\n' @pytest.mark.parametrize("line,title,input,expected", read_fixture_file(FIXTURE_PATH)) def test_all(line, title, input, expected): md = MarkdownIt("commonmark").use(deflist_plugin) if "DISABLE-CODEBLOCKS" in title: md.disable("code") md.options["xhtmlOut"] = False text = md.render(input) print(text) > assert text.rstrip() == expected.rstrip() E AssertionError: assert 'Term 1' == '
\n- Te...1\n
' E -E -- Term 1
E ? ^^ ^^
E + - Definition 1
E ? ^^ ^^ -...
E
E ...Full output truncated (3 lines hidden), use '-vv' to show
tests/test_deflist.py:39: AssertionError
----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------
\na\n \n] __________________________________
line = 575, title = 'Indented by 4 spaces, DISABLE-CODEBLOCKS', input = ' $$a$$\n', expected = '\na\n \n'
@pytest.mark.parametrize(
"line,title,input,expected",
read_fixture_file(FIXTURE_PATH.joinpath("dollar_math.md")),
)
def test_dollarmath_fixtures(line, title, input, expected):
md = MarkdownIt("commonmark").use(
dollarmath_plugin,
allow_space=False,
allow_digits=False,
double_inline=True,
allow_blank_lines=False,
)
if "DISABLE-CODEBLOCKS" in title:
md.disable("code")
md.options.xhtmlOut = False
text = md.render(input)
print(text)
> assert text.rstrip() == expected.rstrip()
E assert 'a ' == '\na\n '
E + a
E -
E - a
E -
tests/test_dollarmath.py:106: AssertionError
----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------
a
__________________________________________________________________ test_all[378-Indented_by_4_spaces,_DISABLE-CODEBLOCKS] ___________________________________________________________________
line = 378, title = 'Indented by 4 spaces, DISABLE-CODEBLOCKS', input = ' :name: text\n indented\n'
expected = '
Term 1
E ? ^ ^ E -Term 1
: Definition 1
_________________________________ test_dollarmath_fixtures[575-Indented by 4 spaces, DISABLE-CODEBLOCKS- $$a$$\n-\n- name
\n- \n
\n
\n' @pytest.mark.parametrize( "line,title,input,expected", fixtures, ids=[f"{f[0]}-{f[1].replace(' ', '_')}" for f in fixtures], ) def test_all(line, title, input, expected): md = MarkdownIt("commonmark").use(fieldlist_plugin) if "DISABLE-CODEBLOCKS" in title: md.disable("code") md.options["xhtmlOut"] = False text = md.render(input) print(text) > assert text.rstrip() == expected.rstrip() E assert 'text\nindented
\n:name: text\nindented
' == 'E -- name
E - -
E -
\n \n] _
line = 360, title = 'Indented by 4 spaces, DISABLE-CODEBLOCKS', input = ' [^1]\n\n [^1]: footnote\n'
expected = ' \n'
@pytest.mark.parametrize("line,title,input,expected", read_fixture_file(FIXTURE_PATH))
def test_all(line, title, input, expected):
md = MarkdownIt("commonmark").use(footnote_plugin)
if "DISABLE-CODEBLOCKS" in title:
md.disable("code")
md.options["xhtmlOut"] = False
text = md.render(input)
print(text)
> assert text.rstrip().replace("↩︎", "<-").replace(
"↩", "<-"
) == expected.rstrip().replace("↩︎", "<-").replace("↩", "<-")
E assert '
text E - indented
E ? -... E E ...Full output truncated (3 lines hidden), use '-vv' to show tests/test_field_list.py:41: AssertionError ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------:name: text indented
_ test_all[360-Indented by 4 spaces, DISABLE-CODEBLOCKS- [^1]\n\n [^1]: footnote\n-[1]
\n\n
\n \n
\nfootnote \u21a9\ufe0e
\n[1]
\n\n
footnote ↩︎
\n\n\n[^1]
\... footnote' == '\n' E +
E -
[^1]
E +[^1]: footnote
E -[1]
E -E -
E -(a)= \n] ___
line = 168, title = 'Indented by 4 spaces, DISABLE-CODEBLOCKS', input = ' +++\n\n % abc\n\n (a)=\n'
expected = '(a)= \n'
@pytest.mark.parametrize("line,title,input,expected", read_fixture_file(FIXTURE_PATH))
def test_all(line, title, input, expected):
md = MarkdownIt("commonmark").use(myst_block_plugin)
if "DISABLE-CODEBLOCKS" in title:
md.disable("code")
md.options["xhtmlOut"] = False
text = md.render(input)
print(text)
> assert text.rstrip() == expected.rstrip()
E assert '(a)=
E + \n \n] - assert '\n\\begin{equation}\n a = 1\n \\end{equation}\n \n] - assert 'head\n] - assert '\n \n] - assert '\na\n \n] - assert 'a ' == '\na\n '
FAILED tests/test_field_list.py::test_all[378-Indented_by_4_spaces,_DISABLE-CODEBLOCKS] - assert '
chrisjsewell
commented
2 months ago
kloczek
commented
2 months ago
chrisjsewell
commented
2 months ago
kloczek
commented
2 months ago
chrisjsewell
commented
2 months ago
kloczek
commented
2 months ago
chrisjsewell
commented
2 months ago
kloczek
commented
2 months ago
- © Githubissues.
- Githubissues is a development platform for aggregating issues.
footnote <-
... E E ...Full output truncated (3 lines hidden), use '-vv' to show tests/test_footnote.py:459: AssertionError ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------[^1]
[^1]: footnote
___ test_all[168-Indented by 4 spaces, DISABLE-CODEBLOCKS- +++\n\n % abc\n\n (a)=\n-\n
\n
+++
\n...\n(a)=
' == 'E -
+++
E +% abc
E +(a)=
tests/test_myst_block.py:21: AssertionError ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------+++
% abc
(a)=
================================================================================== short test summary info ================================================================================== FAILED tests/test_admon.py::test_all[306-Indented by 4 spaces, DISABLE-CODEBLOCKS- ??? note\n content\n-Note
\ncontent
\n??? note\ncontent
' == '\\begin{e...equation}
' == '{#a .a b=c}\n# head
' == 'head
' FAILED tests/test_colon_fence.py::test_fixtures[438-Indented by 4 spaces, DISABLE-CODEBLOCKS- :::name\n foo\n :::\n- \n] - assert ':::name\nfoo\n:::
' == ' ' FAILED tests/test_container.py::test_all[301-Indented by 4 spaces, DISABLE-CODEBLOCKS- ::: name\n content\n :::\n-content
\n::: name\...tent\n:::
' == ':name: text\nindented
' == '[1]\n\n \n] - assert '
\n
\n \n
\nfootnote \u21a9\ufe0e
\n[^1]
\... footnote' == '\n' FAILED tests/test_myst_block.py::test_all[168-Indented by 4 spaces, DISABLE-CODEBLOCKS- +++\n\n % abc\n\n (a)=\n-(a)= \n] - assert '
eamanu
commented
1 year ago
\n
+++
\n...\n(a)=
' == 'Hi @kloczek, same issue in Debian. Please see #92
I'm afraid the tests are not intended for end users, there is no guarantee they work outside of this repository and its CLI/dev setup
Packagers are not end users.
This package is written and distributed for users, not packagers. If you do not want to package it because of the limitations I would understand and encourage you not to
You are forgetting that currently almost none od the end users is using self build and installed software.
So what what is wrong in this case that pytest fails? 🤔
No they are using wheel installs from pypi, using pip or uv, this is the only way I recommend using python packages, and the only focus of support.
The only stipulation on the tests is that they work in the CI, nothing more
Really? Basing on what you are claiming that? 🤔
The 1 million downloads per day from pypi https://pypistats.org/packages/mdit-py-plugins
But look this is not a debate, I'm just doing you the courtesy of letting you know the priority for this repository and in fact for every python package I author/maintain (and has always been).
This is open source software, free, there is no obligation on my part to do anything; if this is not to your taste, you are absolutely welcome to not use it, or to fork it, the choice is yours
Please try to look on those data closer. Most of the downloads are for python version no longer supported by and/or any latest version of any Linux/BSD/Solaris/Win distributions. Those people have no choice ..