Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[run]
branch = true
source =
aurornis
omit = tests.py
13 changes: 11 additions & 2 deletions .github/workflows/doctests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- '3.9'
- '3.10'

name: Python ${{ matrix.python_version }} on ${{ matrix.os }}
name: Python ${{ matrix.python_version }}
steps:
- uses: actions/checkout@v2

Expand All @@ -35,6 +35,15 @@ jobs:
python3 -mpip install -U pip pipenv
pipenv sync --dev

- name: Run tests
- name: Run tests (with coverage)
if: ${{ matrix.python_version == '3.10' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pipenv run coverage run tests.py
pipenv run coveralls --service=github

- name: Run tests (without coverage)
if: ${{ matrix.python_version != '3.10' }}
run: |
make tests
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
__pycache__
dist
*.egg-info
.coverage
2 changes: 2 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ name = "pypi"

[dev-packages]
black = "*"
coveralls = "*"
coverage = "*"

[requires]
python_version = "3"
220 changes: 163 additions & 57 deletions Pipfile.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Aurornis - The Command Line Program Test Helper

[![Coverage Status](https://coveralls.io/repos/github/Deuchnord/Aurornis/badge.svg?branch=main)](https://coveralls.io/github/Deuchnord/Aurornis?branch=main)

Aurornis is a small, yet powerful library designed to help testing command line programs.
The name is a reference to the [_aurornis xui_](https://en.wikipedia.org/wiki/Aurornis), a prehistoric bird that lived 10 millions ago.

Expand Down
7 changes: 7 additions & 0 deletions aurornis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ def run(
>>> c.is_successful()
False

You can also check the execution time of your command.
The object provides two values to facilitate your tests, one in milliseconds:
>>> assert c.exec_time_ms < 500

and one in microseconds:
>>> assert c.exec_time_us < 500000

You can get the text returned to the standard output and error:
>>> c.stdout
''
Expand Down