Closed kloczek closed 2 years ago
@kloczek, thanks for you report.
I have checked and the fact is that the GithubWiki test fails even for older versions of mistletoe. The reason why we haven't noticed this so far is that we use py -m unittest
(which can be seen in the "makefile" of this project) instead of the more-attractive py -m pytest
here. And while pytest
is generally able to run the unittest
tests, this one fails for some reason. I guess it might be due to different tests execution order, or due to specific mocking approach in this test method, or maybe both - help in investigation is welcome. It looks like the mock of RawText
gets created, yet the original class gets used within the test...
Regarding deprecation warnings on invalid escape sequences, this seems to be an unrelated problem which can be fixed easily, so I think I can do that soon.
Note: Regarding reproduction of this issue, it looks like simply cloning mistletoe from GitHub and running the python3 -m pytest
command is sufficient.
The reason why we haven't noticed this so far is that we use
py -m unittest
(which can be seen in the "makefile" of this project) instead of the more-attractivepy -m pytest
here.
BTW unittest
or pytest
never should be used as python -m foo
because when module is used that way pythons automatically adds current directory to os.path
. This why there are pytest
and unittest
scripts which internally iimports those modules and executes the test suite framework code.
@kloczek, OK, yet I can't see what the exact problem can be when calling python -m foo
in this project. According to the latest pytest docs, it is a supported way:
This is almost equivalent to invoking the command line script
pytest [...]
directly, except that calling viapython
will also add the current directory tosys.path
.
Anyway, if some "Python testing guru" could tell why the test GithubWiki fails when run via pytest
, it would be great, even though I guess it is not of that high priority...
You can ask on pytest discussin forum https://github.com/pytest-dev/pytest/discussions
Fixed by #153, merged into master.
I'm trying to package 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 modulesHere is pytest output: