Giter Club home page Giter Club logo

introunittestingcourse's Introduction

Introduction to Unit Testing with Python and GitHub

This repository accompanies the Oxford RSE online course delivered on 17 Feb 2021.

Getting started

Before starting, make sure that you have

  • a GitHub account, and are logged in
  • Git installed on your computer
  • Python installed on your computer, v3.5 or newer
  • a text editor installed on your computer. If you don't have a favourite, we suggest VS Code and the Python extension.
  • Configure GitHub with SSH keys so that you can write to your repository.

If you already have Python installed on your computer, you can check which version you have by opening a terminal (on macOS or Linux) or a command prompt (on Windows) and typing

python3 --version

If you install Python for this course, go to the link above and choose the default option for your operating system. If you install Python on Windows, make sure you click the "add to path" option during installation.

Use this repository as a template

Click the green "Use this template" button at the top of this page. Follow the prompt to give it a name, but otherwise leave the defaults as they are.

On your computer, clone the repository you have just imported:

  • Click the green Code button at the top of the page containing your imported version of this repository
  • Select SSH and copy the text provided
  • From a terminal (on macOS or Linux) or a command prompt (on Windows), run
    git clone <paste-string-here>
    

Create a virtual environment

From a terminal (on macOS or Linux) or a command prompt (on Windows), change to the directory created by running the git command above.

We recommend creating a virtual environment for this course. Type

python3 -m venv venv

On macOS or Linux, activate this environment by running

source venv/bin/activate

On Windows, activate this environment by running

venv\Scripts\activate.bat

Install packages and check everything is working

Run the following commands:

pip install --upgrade pip setuptools wheel
pip install -e .

You should see a message that ends with Successfully installed <list of packages>.

Then run:

pytest -v

You should see a message that ends with

tests/test_models.py::test_everything_works PASSED     [100%]

===================== 1 passed in 0.08s ======================

If you see this, you're all set for the course!

Credits

Some material and code used in this course is based on Software Carpentry courses.

Software Carpentry material is made available under the CC BY 4.0 license, and example code under the MIT license.

introunittestingcourse's People

Contributors

tsc21-ic avatar fcooper8472 avatar abhidg avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.