Open mkhorton opened 5 years ago
nose
runs, it searches for test modules, imports all of the found modules, and then runs the tests. Registry
persists across tests. So, if a test messes with the registry by adding/deleting entries, it must put it back the way it was or clear it before exiting that test module. When import propnet.models
or import propnet.symbols
is called the first time, this populates the registry (and to your second point, the global namespace). However, calling the import again doesn't do anything because the module is already in the list of imported modules. Hence, to re-import and re-populate the registry with built-in models/symbols, that function is present. I am aware that nose is able to clear the global namespace between test modules with flag --with-isolation
, but that breaks test coverage determination.This is one reason I didn't love the import propnet.models/symbols
formalism.
Thanks!
add_builtin_models_to_registry
have to be called?from propnet.symbols.properties import refractive_index
not work ?