Skip to content

Commit

Permalink
Merge pull request #10 from CCBR/tests
Browse files Browse the repository at this point in the history
set up basic testing infrastructure
  • Loading branch information
kopardev authored Apr 16, 2024
2 parents c434932 + 89dfd7c commit 0b63a3d
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: test

on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 2
strategy:
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install .[dev,test]
- name: Test
run: |
python -m pytest
11 changes: 10 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,21 @@ authors = [
license = {file = "LICENSE.md"}
requires-python = ">=3.11"
# keywords = []
dependencies = ["pandas"]
# classifiers = [
# "Programming Language :: Python :: 3",
# "License :: OSI Approved :: MIT License",
# "Operating System :: OS Independent",
# ]
dependencies = ["pandas"]

[project.optional-dependencies]
dev = [
"black >= 22.0.0",
"pre-commit"
]
test = [
"pytest"
]

# [project.urls]
# Homepage = "https://github.com/pypa/sampleproject"
Expand Down
9 changes: 9 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import pytest
import subprocess


def test_help():
output = subprocess.run(
"parkit --help", capture_output=True, shell=True, text=True
).stdout
assert "ERROR:HPC_DM_UTILS in unset!" in output

0 comments on commit 0b63a3d

Please sign in to comment.