Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Mopy/ # no init.py !
- bash/
- __init__.py
- bash.py # <--- Edit: yep there is such a module too
- bass.py
- bosh/
- __init__.py # contains from .. import bass
- bsa_files.py
- ...
- test_bash
- __init__.py # code below
- test_bosh
- __init__.py
- test_bsa_files.py
- import sys
- from os.path import dirname, abspath, join, sep
- mopy = dirname(dirname(abspath(__file__)))
- assert mopy.split(sep)[-1].lower() == 'mopy'
- sys.path.append(mopy)
- print 'Mopy folder appended to path: ', mopy
- import unittest
- from unittest import TestCase
- import bosh
- class TestBSAHeader(TestCase):
- def test_read_header(self):
- bosh.bsa_files.Header.read_header()
- if __name__ == '__main__':
- unittest.main()
- python.exe "C:_JetBrainsPyCharm 2016.2.2helperspycharmutrunner.py" C:pathtoMopytest_bashtest_boshtest_bsa_files.py true
- Traceback (most recent call last):
- File "C:_JetBrainsPyCharm 2016.2.2helperspycharmutrunner.py", line 124, in <module>
- modules = [loadSource(a[0])]
- File "C:_JetBrainsPyCharm 2016.2.2helperspycharmutrunner.py", line 43, in loadSource
- module = imp.load_source(moduleName, fileName)
- File "C:Dropboxeclipse_workspacespythonwrye-bashMopytest_bashtest_boshtest_bsa_files.py", line 4, in <module>
- import bosh
- File "C:Dropboxeclipse_workspacespythonwrye-bashMopybashbosh__init__.py", line 50, in <module>
- from .. import bass
- ValueError: Attempted relative import beyond toplevel package
- if __name__ == '__main__':
- main()
- C:_Python27python.exe "C:_JetBrainsPyCharm 2016.2.2helperspycharmutrunner.py" C:Dropboxeclipse_workspacespythonwrye-bashMopytest_bashtest_boshtest_bsa_files.py true
- Testing started at 3:45 PM ...
- usage: utrunner.py [-h] [-o OBLIVIONPATH] [-p PERSONALPATH] [-u USERPATH]
- [-l LOCALAPPDATAPATH] [-b] [-r] [-f FILENAME] [-q] [-i]
- [-I] [-g GAMENAME] [-d] [-C] [-P] [--no-uac] [--uac]
- [--bashmon] [-L LANGUAGE]
- utrunner.py: error: unrecognized arguments: C:Dropboxeclipse_workspacespythonwrye-bashMopytest_bashtest_boshtest_bsa_files.py true
- Process finished with exit code 2
- import bash.bosh
- from bash import bosh
- # test_bash__init__.py
- sys.path.insert(0, mopy)
- import bosh
- from .. import bass
- import bash.bosh
- from .. import bass
Add Comment
Please, Sign In to add comment