SublimeText / UnitTesting

Testing Sublime Text Packages
MIT License
112 stars 32 forks source link

Simplify reloader #239

Closed deathaxe closed 8 months ago

deathaxe commented 8 months ago

This commit simplifies GitSavvy's reloader from PR #229 by removing intercepting reloading, because it destroys a reloaded package's namespace module by clearing its __path__ or __spec__.module_search_locations.

As a result it was no longer possible to import modules from sub directories, which caused test modules not to be importable any more.

Thus "reload_package_on_testing": true caused all test cases to be vanished.

Actually it should be enough to remove all modules from sys.modules and re-import all top-level plugins in order for all required once to be re-imported in correct order as well.