question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

some problems in run_tests.sh

See original GitHub issue

superset==0.15.4

(env) [root@superset code]# bash run_tests.sh

rm: cannot remove `/root/.superset/unittests.db\r': No such file or directory
rm: cannot remove `/root/.superset/celerydb.sqlite\r': No such file or directory
rm: cannot remove `/root/.superset/celery_results.sqlite\r': No such file or directory
: invalid optionne 8: set: -
set: usage: set [--abefhkmnptuvxBCHP] [-o option-name] [arg ...]
Traceback (most recent call last):
  File "/root/env/bin/superset", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/root/env/code/superset/bin/superset", line 11, in <module>
    from superset.cli import manager
  File "/root/env/code/superset/__init__.py", line 25, in <module>
    app.config.from_object(CONFIG_MODULE)
  File "/root/env/lib/python2.7/site-packages/Flask-0.12-py2.7.egg/flask/config.py", line 168, in from_object
    obj = import_string(obj)
  File "/root/env/lib/python2.7/site-packages/Werkzeug-0.11.10-py2.7.egg/werkzeug/utils.py", line 443, in import_string
    sys.exc_info()[2])
  File "/root/env/lib/python2.7/site-packages/Werkzeug-0.11.10-py2.7.egg/werkzeug/utils.py", line 436, in import_string
    raise ImportError(e)
werkzeug.utils.ImportStringError: import_string() failed for 'tests.superset_test_config\r'. Possible reasons are:

- missing __init__.py in a package;
- package or module path not included in sys.path;
- duplicated package or module name taking precedence in sys.path;
- missing module, class, function or variable;

Debugged import:

- 'tests' found in '/root/env/code/tests/__init__.pyc'.
- 'tests.superset_test_config\r' not found.

Original exception:

'mportError: 'module' object has no attribute 'superset_test_config
Traceback (most recent call last):
  File "/root/env/bin/superset", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/root/env/code/superset/bin/superset", line 11, in <module>
    from superset.cli import manager
  File "/root/env/code/superset/__init__.py", line 25, in <module>
    app.config.from_object(CONFIG_MODULE)
  File "/root/env/lib/python2.7/site-packages/Flask-0.12-py2.7.egg/flask/config.py", line 168, in from_object
    obj = import_string(obj)
  File "/root/env/lib/python2.7/site-packages/Werkzeug-0.11.10-py2.7.egg/werkzeug/utils.py", line 443, in import_string
    sys.exc_info()[2])
  File "/root/env/lib/python2.7/site-packages/Werkzeug-0.11.10-py2.7.egg/werkzeug/utils.py", line 436, in import_string
    raise ImportError(e)
werkzeug.utils.ImportStringError: import_string() failed for 'tests.superset_test_config\r'. Possible reasons are:

- missing __init__.py in a package;
- package or module path not included in sys.path;
- duplicated package or module name taking precedence in sys.path;
- missing module, class, function or variable;

Debugged import:

- 'tests' found in '/root/env/code/tests/__init__.pyc'.
- 'tests.superset_test_config\r' not found.

Original exception:

'mportError: 'module' object has no attribute 'superset_test_config
Traceback (most recent call last):
  File "/root/env/bin/superset", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/root/env/code/superset/bin/superset", line 11, in <module>
    from superset.cli import manager
  File "/root/env/code/superset/__init__.py", line 25, in <module>
    app.config.from_object(CONFIG_MODULE)
  File "/root/env/lib/python2.7/site-packages/Flask-0.12-py2.7.egg/flask/config.py", line 168, in from_object
    obj = import_string(obj)
  File "/root/env/lib/python2.7/site-packages/Werkzeug-0.11.10-py2.7.egg/werkzeug/utils.py", line 443, in import_string
    sys.exc_info()[2])
  File "/root/env/lib/python2.7/site-packages/Werkzeug-0.11.10-py2.7.egg/werkzeug/utils.py", line 436, in import_string
    raise ImportError(e)
werkzeug.utils.ImportStringError: import_string() failed for 'tests.superset_test_config\r'. Possible reasons are:

- missing __init__.py in a package;
- package or module path not included in sys.path;
- duplicated package or module name taking precedence in sys.path;
- missing module, class, function or variable;

Debugged import:

- 'tests' found in '/root/env/code/tests/__init__.pyc'.
- 'tests.superset_test_config\r' not found.

Original exception:

'mportError: 'module' object has no attribute 'superset_test_config
-==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-
VERSION: 0.15.4
GIT SHA: 1edc2b91cf15f669097939c36c6bc8acef5b5913
-==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-
'nvalid command name 'nosetests
: command not found13: coveralls

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
rhunwickscommented, Sep 28, 2017

On a fresh install I get the same as @asdf2014 originally reported: when I run ./run_tests.sh I get:

ImportError: module 'tests' has no attribute 'superset_test_config'

In my case the problem was that the application source directory isn’t on the Python path so when you run run_tests.sh it can’t locate module tests. It works for me if I do

export PYTHONPATH=.
./run_tests.sh
0reactions
asdf2014commented, Sep 28, 2017

@rhunwicks Thanks a lot! 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

run-tests.sh should exit with a failure code if any tests failed
When using run-tests.sh with Gitlab CI it doesn't know there were failures because the script always exits with at status of 0. Proposed ......
Read more >
Using runTests.sh — TYPO3 Contribution Guide
If you have problems with docker, you can run some of the lowlevel scripts and commands directly. However it does depend on your...
Read more >
Permission denied when running .sh scripts - Ask Ubuntu
program exited with code: 126 . This problem always occur when I try to execute my code. What might be the solution? 12.04....
Read more >
'dotnet test' in solution folder fails when non-test projects are in ...
The sh solution is a temporary fix until this is done properly on the cli. Nonetheless, I'm using dotnetcore with Xunit.
Read more >
Python unittest does not run tests - Stack Overflow
I fought with the same exact problem a while ago and I solved it by using test discovery command. python -m unittest discover...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found