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

Replace imp package in runtests.py #174

Closed
joefowler opened this issue Oct 31, 2019 · 4 comments
Closed

Replace imp package in runtests.py #174

joefowler opened this issue Oct 31, 2019 · 4 comments
Labels
bug Something isn't working trivial

Comments

@joefowler
Copy link
Member

Original report by Joseph Fowler (Bitbucket: joe_fowler, ).


We get the following Deprecation when running tests.

runtests.py:1: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp

Make this go away. Also, figure out how to not search through the .git directories for tests.

@joefowler
Copy link
Member Author

Original comment by Joseph Fowler (Bitbucket: joe_fowler, ).


You can import importlib (instead of imp), and try this patch:

- modules.append(imp.load_module(module_name, *imp.find_module(module_name)))
+ modules.append(importlib.import_module(module_name))

But as far as I can tell, it breaks the build on Python 2.7 and slows down tests on Python 3.7. I think I’ll put this issue on hold.

@joefowler
Copy link
Member Author

Original comment by Joseph Fowler (Bitbucket: joe_fowler, ).


Can't figure out a solution that works well on Python 2 and 3. @{557058:9524f6a0-ef9f-4466-b913-d04e51ff9093} suggests a simpler loop over files, which is fine. But this isn't worth any more time than I already put into it.

@joefowler
Copy link
Member Author

Original comment by Joseph Fowler (Bitbucket: joe_fowler, ).


Removing milestone: v0.7 (automated comment)

@joefowler
Copy link
Member Author

This was fixed by the time of version 0.7.3 in March 2020.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working trivial
Projects
None yet
Development

No branches or pull requests

1 participant