-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Preserve order of Python Markdown extensions #486
Conversation
Python Markdown inclusion order can be important when including various custom extensions. Conflicts can arise as to where extensions get inserted in the workflow. By preserving order of how extensions are defined in the settings file, this can allow a user to control insertion order and work around these issues. As Py26 supported is noted to be removed in the future, I saw no reason to add additional dependencies for OrderedDict. Try catch statements can be removed when Py26 support is removed.
@@ -67,3 +68,34 @@ def test_create_media_urls(self): | |||
for path, expected_result in expected_results.items(): | |||
urls = utils.create_media_urls(site_navigation, [path]) | |||
self.assertEqual(urls[0], expected_result) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than try/catching in the unittest I'd prefer:
@unittest.skipIf(sys.version_info[:2] == (2, 6))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the Py26 unittest lib has skipIf
. Seems to be new in Py31 https://docs.python.org/3/library/unittest.html#skipping-tests-and-expected-failures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, of course, sorry. It is in py27 but not py26, so nevermind!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was just about to correct about the Py31 to Py27. But yeah, it would have been much cleaner.
One mine comment, otherwise happy to merge this. Thanks! |
Preserve order of Python Markdown extensions
Thanks again! |
Python Markdown inclusion order can be important when including various custom extensions. Conflicts can arise as to where extensions get inserted in the workflow. By preserving order of how extensions are
defined in the settings file, this can allow a user to control insertion order and work around these issues. As Py26 supported is noted to be removed in the future, I saw no reason to add additional dependencies for OrderedDict. Try catch statements can be removed when Py26 support is removed.