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

Add Try/Except around imporlib.reload for unit test to run in python2.7 as well as 3.4+ #949

Conversation

avrata
Copy link
Contributor

@avrata avrata commented Apr 21, 2021

The test_plugin_detection test was failing for me in python 2.7 due to a missing importlib.reload(). I believe this is only available in python 3.4+.

This change lets the test fall back to imp.reload() in cases where it can't find the importlib one.

There is a related question about how the 2.7 tests did not detect this which I think is related to a missing mock module. I'll follow up offline about that.

tests/test_plugin_detection.py Outdated Show resolved Hide resolved
tests/test_plugin_detection.py Show resolved Hide resolved
@ssteinbach
Copy link
Collaborator

Very small request - just want to put comments in that are like the other comments in the codebase to make it easier to find this via future Grepping. thanks!

avrata and others added 2 commits April 22, 2021 19:48
Co-authored-by: Stephan Steinbach <61017+ssteinbach@users.noreply.github.com>
Co-authored-by: Stephan Steinbach <61017+ssteinbach@users.noreply.github.com>
@ssteinbach ssteinbach merged commit acdc1d1 into AcademySoftwareFoundation:master Apr 23, 2021
@ssteinbach ssteinbach changed the title Allow test to run in both python 2.7 and python 3.3+ wrt reloading modules Add Try/Except around imporlib.reload for unit test to run in python2.7 as well as 3.4+ Apr 23, 2021
@ssteinbach ssteinbach added this to the Public Beta 14 milestone Apr 23, 2021
@ssteinbach ssteinbach added this to In progress in WG: Build Improvements via automation Apr 23, 2021
@jminor jminor moved this from In progress to Done in WG: Build Improvements Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants