diff --git a/.travis.yml b/.travis.yml index fe15c5575..2f28c102f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,10 +39,13 @@ matrix: - echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list - curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add - - sudo apt-get update && sudo apt-get install bazel make + - sudo apt install python3-dev + - pip install -U pytest --user script: make all before_install: - sudo apt install python3-dev + - pip install -U pytest --user - go get github.com/axw/gocov/gocov - go get github.com/mattn/goveralls - go get github.com/fatih/color diff --git a/setup.py b/setup.py index 0e184d320..242c6ae78 100644 --- a/setup.py +++ b/setup.py @@ -16,6 +16,7 @@ from setuptools import setup from setuptools import Extension from setuptools.command.build_ext import build_ext as BuildExt +from setuptools.command.test import test as TestCommand from subprocess import Popen, PIPE DIR = os.path.abspath(os.path.dirname(__file__)) @@ -45,6 +46,10 @@ def run(self): BuildExt.run(self) +class NoopTestCommand(TestCommand): + def __init__(self, dist): + print("_gojsonnet does not support running tests with 'python setup.py test'. Please run 'pytest'.") + jsonnet_ext = Extension( '_gojsonnet', sources=MODULE_SOURCES, @@ -63,7 +68,7 @@ def run(self): version=get_version(), cmdclass={ 'build_ext': BuildJsonnetExt, + 'test': NoopTestCommand, }, ext_modules=[jsonnet_ext], - test_suite="python._jsonnet_test", ) diff --git a/tests.sh b/tests.sh index 0efbf15fe..891ffc3d3 100755 --- a/tests.sh +++ b/tests.sh @@ -14,8 +14,8 @@ then else c-bindings-tests/run.sh - $PYTHON_COMMAND setup.py build - $PYTHON_COMMAND setup.py test + $PYTHON_COMMAND setup.py build --build-platlib . + $PYTHON_COMMAND -m pytest python fi export IMPLEMENTATION=golang