Skip to content

Remove pytest version constraint#22626

Merged
jmbowman merged 3 commits intomasterfrom
jmbowman/upgrade_pytest
Dec 30, 2019
Merged

Remove pytest version constraint#22626
jmbowman merged 3 commits intomasterfrom
jmbowman/upgrade_pytest

Conversation

@jmbowman
Copy link
Copy Markdown
Contributor

@jmbowman jmbowman commented Dec 27, 2019

Fix the issue that was preventing us from upgrading pytest. pytest does some manipulation of test packages that prevents pkg_resources from loading resources from them, but used to contain a workaround for the problem. That workaround was removed in 4.6.0 as a performance enhancement when pytest switched from pkg_resources to importlib-metadata for its own entrypoint handling. This tripped up one of our test modules which defined classes that loaded templates from inside a test package. Moving these resources to the parent package fixes the problem.

More and more, pkg_resources is being abandoned in favor of importlib-metadata and importlib_resources as they have a simpler design with much better performance. However, importlib_resources doesn't support loading files from any directory which isn't itself a Python package (and doesn't allow direct use of paths including directories within the package). Jinja2 chose a different approach that we may want to emulate in our resource handling.

Also fixed usage of a removed pytest.raises() parameter and a bug in our configuration of the common/lib tests that became a problem after the upgrade.

@jmbowman jmbowman requested a review from a team December 27, 2019 16:27
@edx-status-bot
Copy link
Copy Markdown

Your PR has finished running tests. There were no failures.

@jmbowman jmbowman merged commit 63574e1 into master Dec 30, 2019
@jmbowman jmbowman deleted the jmbowman/upgrade_pytest branch December 30, 2019 14:11
@edx-pipeline-bot
Copy link
Copy Markdown
Contributor

EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Copy Markdown
Contributor

EdX Release Notice: This PR has been deployed to the production environment.

@edx-pipeline-bot
Copy link
Copy Markdown
Contributor

EdX Release Notice: This PR has been rolled back from the production environment.

@edx-pipeline-bot
Copy link
Copy Markdown
Contributor

EdX Release Notice: This PR has been deployed to the production environment.

@edx-pipeline-bot
Copy link
Copy Markdown
Contributor

EdX Release Notice: This PR has been rolled back from the production environment.

@edx-pipeline-bot
Copy link
Copy Markdown
Contributor

EdX Release Notice: This PR has been deployed to the production environment.

@edx-pipeline-bot
Copy link
Copy Markdown
Contributor

EdX Release Notice: This PR has been rolled back from the production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Copy Markdown
Contributor

EdX Release Notice: This PR has been rolled back from the production environment.

@edx-pipeline-bot
Copy link
Copy Markdown
Contributor

EdX Release Notice: This PR has been deployed to the production environment.

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.

4 participants