Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
banesullivan committed Dec 11, 2020
1 parent dd537d1 commit cf95375
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Testing

on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
jobs:
setup-build:
name: Ex1 (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: [3.7, 3.8]

steps:
- uses: actions/checkout@v2
- name: Setup Conda
uses: s-weigand/setup-conda@v1
with:
update-conda: true
conda-channels: conda-forge
python-version: ${{ matrix.python-version }}

- name: Install Env
shell: bash
run: |
python --version
conda env create -f environment.yml
- name: Install Our Package
shell: bash
run: |
source activate agu-ossi-2020
pip install -e .
- name: Run Tests
shell: bash
run: |
source activate agu-ossi-2020
pytest -v .
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ dependencies:
- geoana
- SimPEG
- pymatsolver
- pytest
13 changes: 13 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# coding=utf-8
import setuptools

__version__ = '0.0.0'

setuptools.setup(
name="agu_oss",
version=__version__,
author="AGU OSS Team",
description="AGU 2020 Example Package",
url="https://github.com/agu-ossi/2020-agu-oss",
packages=setuptools.find_packages(),
)
Empty file added tests/__init__.py
Empty file.
11 changes: 11 additions & 0 deletions tests/test_basic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import pytest

# Module to be tested
import agu_oss


def test_division():
assert agu_oss.divide(6, 2) == 3

with pytest.raises(TypeError):
agu_oss.divide(6, '2')

0 comments on commit cf95375

Please sign in to comment.