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
50 changes: 35 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,50 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: GitHub Action for pytest
uses: cclauss/GitHub-Action-for-pytest@0.5.0
- name: Coveralls Python
# You may pin to the exact commit or the version.
# uses: AndreMiras/coveralls-python-action@f5fd5c309b39d01599fb92c72d4f7409ea78aec9
uses: AndreMiras/coveralls-python-action@v20201129
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install pipx and Poetry
run: |
pip install pipx &&
pipx ensurepath &&

python --version &&

pipx install poetry==1.8.4 &&
poetry --version

- name: Install dependencies
run: |
poetry install

- name: Run tests
run: |
poetry run pytest tests --junit-xml=tests-results.xml

- name: Render test results
if: success() || failure()
uses: dorny/test-reporter@v1
continue-on-error: true
with:
name: Test results
path: '**/tests-results.xml'
reporter: java-junit

53 changes: 20 additions & 33 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 1 addition & 9 deletions tests/toml_cli/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def test_search(tmp_path: pathlib.Path):

result = runner.invoke(app, ["search", "--toml-path", str(test_toml_path), "wrong-expression"])
assert result.exit_code == 1
assert "error: invalid jmespath expression" in result.stdout
assert "error: invalid jmespath expression" in result.stderr


def test_set_value(tmp_path: pathlib.Path):
Expand Down Expand Up @@ -323,11 +323,3 @@ def test_unset(tmp_path: pathlib.Path):
result = runner.invoke(app, ["unset", "--toml-path", str(test_toml_path), "person"])
assert result.exit_code == 0
assert len(test_toml_path.read_text()) == 1 # just a newline


def test_no_command():
result = runner.invoke(app, [])
assert result.exit_code == 2
assert "--help" in result.stdout
assert "Commands" in result.stdout
assert "Commands" in result.stdout
Loading