diff --git a/tests/docker/languages/Dockerfile.testing.python.numpy.cpython_2_7_15 b/tests/docker/languages/Dockerfile.testing.python.numpy.cpython_2_7_15 new file mode 100644 index 000000000..718c5ac5a --- /dev/null +++ b/tests/docker/languages/Dockerfile.testing.python.numpy.cpython_2_7_15 @@ -0,0 +1,9 @@ +FROM python:2.7.15-slim-stretch as base +WORKDIR /code +ADD . . +RUN cp flatc_debian_stretch flatc +WORKDIR /code/tests +RUN python --version +RUN pip install numpy +RUN pip install coverage +RUN ./PythonTest.sh diff --git a/tests/docker/languages/Dockerfile.testing.python.numpy.cpython_3_7_1 b/tests/docker/languages/Dockerfile.testing.python.numpy.cpython_3_7_1 new file mode 100644 index 000000000..1de2c2680 --- /dev/null +++ b/tests/docker/languages/Dockerfile.testing.python.numpy.cpython_3_7_1 @@ -0,0 +1,9 @@ +FROM python:3.7.1-slim-stretch as base +WORKDIR /code +ADD . . +RUN cp flatc_debian_stretch flatc +WORKDIR /code/tests +RUN python --version +RUN pip install numpy +RUN pip install coverage +RUN ./PythonTest.sh diff --git a/tests/py_test.py b/tests/py_test.py index ee2fb36ba..f811214e8 100644 --- a/tests/py_test.py +++ b/tests/py_test.py @@ -2368,6 +2368,13 @@ def main(): kwargs = dict(argv=sys.argv[:-3]) + # show whether numpy is present, as it changes the test logic: + try: + import numpy + print('numpy available') + except ImportError: + print('numpy not available') + # run tests, and run some language comparison checks if needed: success = backward_compatible_run_tests(**kwargs) if success and os.environ.get('COMPARE_GENERATED_TO_GO', 0) == "1":