Skip to content

Commit

Permalink
add setup.py test command
Browse files Browse the repository at this point in the history
  • Loading branch information
almarklein committed Dec 17, 2014
1 parent f0ff2bc commit 162fb14
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import os.path as op
import sys
import shutil
from distutils.core import Command
from distutils.command.sdist import sdist
from distutils.command.build_py import build_py

Expand Down Expand Up @@ -169,6 +170,19 @@ def _set_platform_resources(resource_dir, platform):
# force_download=True)


class test_command(Command):
user_options = []
def initialize_options(self):
pass

def finalize_options(self):
pass

def run(self):
from imageio import testing
sys.exit(testing.test_unit())


class build_with_fi(build_py):
def run(self):
# Download images and libs
Expand Down Expand Up @@ -256,7 +270,9 @@ def _create_dists_for_platform(self, resource_dir, plat):


setup(
cmdclass={'sdist_all': sdist_all, 'build_with_fi': build_with_fi},
cmdclass={'sdist_all': sdist_all,
'build_with_fi': build_with_fi,
'test': test_command},

name = name,
version = __version__,
Expand Down

0 comments on commit 162fb14

Please sign in to comment.