From 8cc0b91d240be12d650663d1caf6be057f4fd882 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 30 Apr 2015 10:50:19 +0700 Subject: [PATCH 1/2] Run tests on Travis with both Python 2.7 and 3.4, using miniconda to get packages. --- .travis.yml | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1e0e0790a0..21d110b40c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,35 @@ +language: python +python: + - "2.7" + - "3.4" + before_install: - - sudo apt-get update -qq - - sudo apt-get install -qq -y python-numpy - - sudo apt-get install -qq -y python-scipy - - sudo apt-get install -qq -y python-h5py - - sudo apt-get install -qq -y gfortran - - sudo apt-get install -qq -y g++ + # ============== Handle Python third-party packages ============== + - sudo apt-get update + - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then + wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh; + else + wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; + fi + - bash miniconda.sh -b -p $HOME/miniconda + - export PATH="$HOME/miniconda/bin:$PATH" + - hash -r + - conda config --set always_yes yes --set changeps1 no + - conda update -q conda + - conda info -a + - conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION numpy scipy h5py + - source activate test-environment + + # ============== Install GCC, MPICH, HDF5, PHDF5 ============== + - sudo apt-get install -qq -y gfortran g++ - ./tests/travis_install.sh - export FC=gfortran - export MPI_DIR=$PWD/mpich_install - export PHDF5_DIR=$PWD/phdf5_install - export HDF5_DIR=$PWD/hdf5_install +install: true + before_script: - cd data - git clone --branch=master git://github.com/bhermanmit/nndc_xs nndc_xs From 85ca39ff3846837f049d62dfa60183781cc000db Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 25 May 2015 12:50:22 +0700 Subject: [PATCH 2/2] Fix Python 3-related error in test_trace --- tests/test_trace/test_trace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_trace/test_trace.py b/tests/test_trace/test_trace.py index 59488412c7..eab3f922aa 100644 --- a/tests/test_trace/test_trace.py +++ b/tests/test_trace/test_trace.py @@ -23,7 +23,7 @@ def test_run(): print(stdout) returncode = proc.returncode assert returncode == 0, 'OpenMC did not exit successfully.' - assert stdout.find('Simulating Particle 453') != -1 + assert stdout.find(b'Simulating Particle 453') != -1 def test_created_statepoint(): statepoint = glob.glob(os.path.join(cwd, 'statepoint.10.*'))