-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add conftest and skip broken marker * Use pytest parametrize, skip broken tests * Add pytest-cov to requirements * Replace TravisCI with GH Workflows * Constrain package versions
- Loading branch information
1 parent
25728bb
commit f6126eb
Showing
7 changed files
with
134 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12-dev"] | ||
steps: | ||
- name: Checkout project | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Set up venv | ||
shell: bash | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
python3 -m venv .venv | ||
- name: Install project | ||
shell: bash | ||
run: | | ||
source .venv/bin/activate | ||
python3 -m pip install ".[dev]" | ||
- name: Test | ||
run: .venv/bin/python3 -m pytest --cov=texthero --cov-report=term-missing --cov-report xml --cov-branch | ||
|
||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v3 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import pytest | ||
|
||
|
||
def pytest_addoption(parser): | ||
parser.addoption( | ||
"--no-skip-broken", | ||
action="store_true", | ||
default=False, | ||
help="run tests marked as broken", | ||
) | ||
|
||
|
||
def pytest_configure(config): | ||
config.addinivalue_line("markers", "skip_broken: mark test broken") | ||
|
||
|
||
def pytest_collection_modifyitems(config, items): | ||
if config.getoption("--no-skip-broken"): | ||
return | ||
|
||
skip_broken = pytest.mark.skip(reason="test marked as broken") | ||
for item in items: | ||
if "skip_broken" in item.keywords: | ||
item.add_marker(skip_broken) | ||
|
||
|
||
def broken_case(*params): | ||
return pytest.param(*params, marks=(pytest.mark.skip_broken)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.