mirror of
https://github.com/httpie/cli.git
synced 2024-11-22 07:43:20 +01:00
6039bd8582
* Convert most of the documentation from the frontend `README.rst` to `docs/REAME.md` Also converted all reStructuredText files to Markdown. * Tell `mdformat` to use LF for end on lines * `--check` is not needed in the help message * Skip tests on GitHub Windows. Those tests pass on a real Windows machine. Let's revisit those failure later, if needed. * Move `mdoformat` requirement from `test` to `dev` extra To fix Fedora CI.
36 lines
858 B
Python
36 lines
858 B
Python
import os
|
|
|
|
import pytest
|
|
from httpie.compat import is_windows
|
|
|
|
from .utils import TESTS_ROOT
|
|
|
|
|
|
ROOT = TESTS_ROOT.parent
|
|
SOURCE_DIRECTORIES = [
|
|
'docs',
|
|
'extras',
|
|
'httpie',
|
|
'tests',
|
|
]
|
|
|
|
|
|
def md_filenames():
|
|
yield from ROOT.glob('*.md')
|
|
for directory in SOURCE_DIRECTORIES:
|
|
yield from (ROOT / directory).glob('**/*.md')
|
|
|
|
|
|
filenames = sorted(md_filenames())
|
|
assert filenames
|
|
|
|
|
|
@pytest.mark.skipif(is_windows and 'CI' in os.environ,
|
|
reason='Does not pass on GitHub.')
|
|
@pytest.mark.parametrize('filename', filenames)
|
|
def test_md_file_syntax(filename):
|
|
mdformat = pytest.importorskip('mdformat._cli')
|
|
args = ['--end-of-line', 'lf', '--number']
|
|
err = f'Running "python -m mdformat {" ".join(args)} {filename}; git diff" should help.'
|
|
assert mdformat.run(args + ['--check', str(filename)]) == 0, err
|