Overview
Teaching: min Exercises: 10 minQuestions
Can I add more tests?
Objectives
Add more tests
Copy the participants.tsv
file to participants2.tsv
and modify ages of a few participants.
Make your script read the data path from the command line:
import sys
import numpy as np
age = np.loadtxt(sys.argv[1], skiprows=1, usecols=3)
mean_age = sum(age)/len(age)
np.savetxt("demeaned_" + sys.argv[1], age-mean_age)
print("done!")
version: 2
jobs:
build:
docker:
- image: circleci/python:3.6.1
steps:
- checkout
- run:
name: Install Python deps in a virtual environment
command: |
python3 -m venv myenv
. myenv/bin/activate
pip install numpy
- run:
command: |
. myenv/bin/activate
python demean_age.py participants.tsv
- run:
command: |
. myenv/bin/activate
python demean_age.py participants2.tsv
Commit all changes and see the tests run on CircleCI.
Key Points
Adding more smoke tests is easy