Skip to content
This repository has been archived by the owner on Mar 25, 2022. It is now read-only.

Tests fail with python 3 #13

Closed
fzesch opened this issue Sep 16, 2015 · 1 comment
Closed

Tests fail with python 3 #13

fzesch opened this issue Sep 16, 2015 · 1 comment

Comments

@fzesch
Copy link
Collaborator

fzesch commented Sep 16, 2015

The tests fail with python 3. It seems as if the import of two modules (input_numper.py and dbhelper.py) does not occur properly and only works at runtime of the project. It works with Python 2, though.

My errors:

With running in PyCharm 4.5:
Testing started at 21:58 ...
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm 4.5.4\helpers\pycharm\utrunner.py", line 139, in
module = loadSource(a[0])
File "C:\Program Files (x86)\JetBrains\PyCharm 4.5.4\helpers\pycharm\utrunner.py", line 41, in loadSource
module = imp.load_source(moduleName, fileName)
File "C:\Python34\lib\imp.py", line 171, in load_source
module = methods.load()
File "", line 1220, in load
File "", line 1200, in _load_unlocked
File "", line 1129, in _exec
File "", line 1471, in exec_module
File "", line 321, in _call_with_frames_removed
File "H:\Python Scripts\lagesonum\tests\lagesonum_tests.py", line 4, in
from lagesonum.bottle_app import application, DB_PATH
File "H:\Python Scripts\lagesonum\lagesonum\bottle_app.py", line 14, in
import input_number as ip
ImportError: No module named 'input_number'

Process finished with exit code 1

On command line:
Traceback (most recent call last):
File "H:\Python Scripts\lagesonum\tests\lagesonum_tests.py", line 4, in
from lagesonum.bottle_app import application, DB_PATH
ImportError: No module named 'lagesonum'

@fzesch fzesch mentioned this issue Sep 16, 2015
@fzesch
Copy link
Collaborator Author

fzesch commented Sep 17, 2015

The problem was, that due to the folder structure, Python expected

import lagesonum.input_number
instead of import input_number

At runtime, it looked in other paths too.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant