You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Half of the tests contain this anti-pattern or boiler-plate, which ought not be needed:
try:
importpathLocateexcept:
fromunittestsimportpathLocate# Add parent folder to python pathunittest_dir=pathLocate.getUnitTestDirectory()
sys.path.append(pathLocate.getRootDirectory())
The manipulation of sys.path should be unnecessary if the tests are invoked from an appropriate context.
Use of this approach (pathLocate inspects __file__) for finding absolute paths to resources (such as config files and test data) is discouraged in favour of importlib.resources (preferred) or pkg_resources (as noted in issue #65).
Also, unclear what unittests.pathLocate should be.
The text was updated successfully, but these errors were encountered:
Half of the tests contain this anti-pattern or boiler-plate, which ought not be needed:
The manipulation of
sys.path
should be unnecessary if the tests are invoked from an appropriate context.Use of this approach (
pathLocate
inspects__file__
) for finding absolute paths to resources (such as config files and test data) is discouraged in favour ofimportlib.resources
(preferred) orpkg_resources
(as noted in issue #65).Also, unclear what
unittests.pathLocate
should be.The text was updated successfully, but these errors were encountered: