Error: RuntimeWarning: Parent module 'hooks' not found while handling absolute import
See original GitHub issueI’m facing this output while running dredd
with python
hooks enabled:
info: Configuration dredd.yml found, ignoring other arguments.
info: Using apiary reporter.
info: Beginning Dredd testing...
info: Found Hookfiles: ./hooks.py
info: Spawning `python` hooks handler
info: Hook handler stderr: ./hooks.py:1: RuntimeWarning: Parent module 'hooks' not found while handling absolute import
import dredd_hooks as hooks
info: Hook handler stdout: Starting Dredd Python hooks handler
info: Connected to the hook handler, waiting 0.1s to start testing.
info: Dry run, skipping API Tests...
info: Dry run, skipping API Tests...
info: Dry run, skipping API Tests...
info: Dry run, skipping API Tests...
info: Dry run, skipping API Tests...
info: Dry run, skipping API Tests...
info: Sending SIGTERM to the hooks handler
info: Hook handler stderr:
Connection closed
My config is:
reporter: apiary
custom:
apiaryApiKey: f941658c6714ebf58eeda5e0786e937f
apiaryApiName: xos
dry-run: null
hookfiles: "./hooks.py"
language: python
sandbox: false
server: null
server-wait: 3
init: false
names: false
only: []
output: []
header: []
sorted: false
user: null
inline-errors: false
details: false
method: []
color: true
level: info
timestamp: false
silent: false
path: []
hooks-worker-timeout: 5000
hooks-worker-connect-timeout: 1500
hooks-worker-connect-retry: 500
hooks-worker-after-connect-wait: 100
hooks-worker-term-timeout: 5000
hooks-worker-term-retry: 500
hooks-worker-handler-host: localhost
hooks-worker-handler-port: 61321
blueprint: apiary.apib
endpoint: 'http://localhost:3000'
My hooks.py
file is:
import dredd_hooks as hooks
@hooks.before_each
def my_before_each_hook(transaction):
print('before each')
How can I solve this?
Thanks
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Parent module 'plugins' not found while handling absolute ...
This function does not handle hierarchical module names (names containing dots). In order to find P.M, that is, submodule M of package P,...
Read more >Parent module 'YOUR_MODULE_HERE' not found while ...
RuntimeWarning : Parent module 'YOUR_MODULE_HERE' not found while handling absolute import. When running tests from any submodule within test , my PyCharm ...
Read more >RuntimeWarning: Parent module 'plugins' not found while ...
Python – Dynamic class loading in Python 2.6: RuntimeWarning: Parent module 'plugins' not found while handling absolute import.
Read more >Absolute vs Relative Imports in Python
If you've worked on a Python project that has more than one file, chances are you've had to use an import statement before....
Read more >6. Modules — Python 3.11.1 documentation
Now enter the Python interpreter and import this module with the following command: ... If not found, it then searches for a file...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@teone I’m glad we worked it out! However, I’ll leave this open to have a reminder this needs to go to docs. I added respective labels.
This won’t go to docs! 😱 Why? Because it’s no more an issue thanks to https://github.com/apiaryio/dredd-hooks-python/pull/20! 🎉