Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Unit Tests #65

Merged
merged 2 commits into from
Feb 20, 2022
Merged

Fix Unit Tests #65

merged 2 commits into from
Feb 20, 2022

Conversation

YDX-2147483647
Copy link
Contributor

@YDX-2147483647 YDX-2147483647 commented Feb 19, 2022

Quote in headingWithPipes.md

Previous unit test headingWithPipes fails because of the quote.

The HTML generated by Jekyll in _site/:

<li>Doesn’t</li>

<!-- /// -->

<li>Doesn&#8217;t</li>

(It's more complicated in original version. I manually edit the HTML file to this.)

What tests.py thinks:

ACTUAL: <li>Doesn&#37413;&#27291; Exist</li>
EXPECT: <li>Doesn&#8217;t Exist</li>

If I add encoding='utf-8' when opening files in tests.py, it becomes OK. (python open() with GBK by default on Windows 10 Chinese ver. — It depends on locale.) Therefore, this might be a platform-dependent issue, and do not imply toc.html or Jekyll works wrongly.

So I remove the quote.

Python 2.7 in Contributing Guide

Change the python version from 2.7 to 3 in contributing guide. I think it was a mistake.

Details on the Python Version

The contributing guide says

run the Python script (requires 2.7)

In tests.py, there's even f-string (a python 3.6 feature)!

print(f">> Invalid XML in {test_file}")

I run tests.py in python 3.7 - 3.10, and all works. (python 2.7 and 3.6 are both end-of-life)

Python 2.7 is a mistake: there's a f-string in `tests.py`,
which is a python 3.6 feature.
@allejo
Copy link
Owner

allejo commented Feb 20, 2022

Encodings strike again! 🤦 Thank you for the change on making the test more robust and for correcting the CONTRIBUTING, this was in fact, incorrect.

@allejo allejo merged commit 7ad0be4 into allejo:master Feb 20, 2022
@YDX-2147483647 YDX-2147483647 deleted the tests-py branch February 20, 2022 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants