I couldn't find answer after having read all the following:
- PEP 338 Executing modules as scripts
- documentation of
runpystandard module - description of Python interpreter's
-moption
Rationale:
When a test script which uses relative imports is being run without -m option I could print a warning message instead of leaving user with standard traceback leading to ValueError: Attempted relative import in non-package exception. Without knowing this I can catch this exception and only suggest lack of -m option could be the reason of error.