Skip to content

Commit

Permalink
Skip markdown tests if cmarkgfm is not installed. (#278)
Browse files Browse the repository at this point in the history
* Skip markdown tests if `cmarkgfm` is not installed.

* Run tests without extras.
  • Loading branch information
tillahoffmann authored Apr 29, 2023
1 parent 584de34 commit 8f1fb59
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ jobs:
- name: Install dependencies
run: python -m pip install tox
- name: Run tests
run: python -m tox -e py
run: |
python -m tox -e py
python -m tox -e noextra
lint:
name: Lint
runs-on: ubuntu-latest
Expand Down
6 changes: 5 additions & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
@pytest.fixture(params=["test_CommonMark_001.md", "test_rst_003.rst",
"test_GFM_001.md", "test_txt_001.txt"])
def input_file(request):
return pathlib.Path("tests/fixtures", request.param)
path = pathlib.Path("tests/fixtures", request.param)
# Skip markdown tests if the cmarkgfm optional dependency is not installed.
if path.suffix == ".md":
pytest.importorskip("cmarkgfm")
return path


@pytest.mark.parametrize("output_file", [False, True])
Expand Down

0 comments on commit 8f1fb59

Please sign in to comment.