Skip to content

Use PEP451 loader to work around pytest/jinja2 disagreements (#387)#388

Merged
tobywf merged 3 commits into
aws-cloudformation:masterfrom
stilvoid:fix-jinja2-package-loading
Jan 30, 2020
Merged

Use PEP451 loader to work around pytest/jinja2 disagreements (#387)#388
tobywf merged 3 commits into
aws-cloudformation:masterfrom
stilvoid:fix-jinja2-package-loading

Conversation

@stilvoid
Copy link
Copy Markdown
Contributor

Issue #, if available: 387

Description of changes: Work around update to Jinja2 that breaks pytest's mangling of module loaders.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@stilvoid stilvoid closed this Jan 30, 2020
@stilvoid stilvoid deleted the fix-jinja2-package-loading branch January 30, 2020 16:50
@stilvoid stilvoid restored the fix-jinja2-package-loading branch January 30, 2020 16:51
@stilvoid stilvoid reopened this Jan 30, 2020
@stilvoid stilvoid requested a review from tobywf January 30, 2020 16:52
@tobywf
Copy link
Copy Markdown
Contributor

tobywf commented Jan 30, 2020

Possibly it was this commit: pallets/jinja#1113

This seems to fix the lower pytest version we were needing to use (pytest-dev/pytest#5392), this was always a bit hacky it seems. I don't quite understand in which cases spec or spec.origin can be None, and did toy around with the idea of removing PackageLoader entirely.

The only other things I did was split the inline if, it seems to not give branch coverage, and use pathlib - I don't think we use os anywhere in the core lib, so it just keeps things consistent.

@tobywf tobywf merged commit 3e323d6 into aws-cloudformation:master Jan 30, 2020
@stilvoid stilvoid deleted the fix-jinja2-package-loading branch January 31, 2020 08:54
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.

3 participants