Skip to content

Commit

Permalink
Merge pull request #19 from sot/runnable-tests
Browse files Browse the repository at this point in the history
Make tests runnable from installed package with xija.test()
  • Loading branch information
taldcroft committed Apr 7, 2013
2 parents 87e5a1d + 8466f80 commit 2a334a7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
'Topic :: Scientific/Engineering :: Physics',
'Programming Language :: Python :: 2',
],
packages=['xija', 'xija.component'],
package_data={'xija': ['libcore.so']},
packages=['xija', 'xija.component', 'xija.tests'],
package_data={'xija': ['libcore.so'],
'xija.tests': ['*.npz', '*.json']},
)
5 changes: 5 additions & 0 deletions xija/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@
from .component import *
from .files import files
from .version import version as __version__

def test(*args, **kwargs):
"""Run self tests"""
from . import tests
tests.test(*args, **kwargs)
9 changes: 9 additions & 0 deletions xija/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"""
Run self-tests
"""

def test(*args, **kwargs):
import os
import pytest
os.chdir(os.path.dirname(__file__))
pytest.main(*args, **kwargs)
2 changes: 1 addition & 1 deletion xija/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
restrictions therein are applicable.
"""

version = '0.3.1'
version = '0.3.2'

_versplit = version.replace('dev', '').split('.')
major = int(_versplit[0])
Expand Down

0 comments on commit 2a334a7

Please sign in to comment.