File size: 2,119 Bytes
065fee7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# To use tox, see https://tox.readthedocs.io
# Simply pip or conda install tox
# If you use conda, you may also want to install tox-conda
# then run `tox` or `tox -- {pytest args}`
# run in parallel using `tox -p`
[tox]
envlist = py38
[testenv]
usedevelop = true
[testenv:py{38,39,310,311}]
extras =
linkify
testing
commands = pytest {posargs:tests/}
[testenv:py{38,39,310,311}-plugins]
extras = testing
changedir = {envtmpdir}
allowlist_externals =
git
pip
commands_pre =
git clone https://github.com/executablebooks/mdit-py-plugins.git
pip install --no-deps -e mdit-py-plugins
commands =
pytest {posargs}
[testenv:py{38,39,310,311}-bench-core]
extras = benchmarking
commands = pytest benchmarking/bench_core.py {posargs}
[testenv:py{38,39,310,311}-bench-packages]
extras = benchmarking,compare
commands = pytest benchmarking/bench_packages.py {posargs}
[testenv:docs-{update,clean}]
extras = linkify,plugins,rtd
whitelist_externals =
echo
rm
setenv =
update: SKIP_APIDOC = true
commands =
clean: rm -rf docs/_build
sphinx-build -nW --keep-going -b {posargs:html} docs/ docs/_build/{posargs:html}
commands_post = echo "open file://{toxinidir}/docs/_build/{posargs:html}/index.html"
[testenv:profile]
description = run profiler (use e.g. `firefox .tox/prof/output.svg` to open)
extras = profiling
allowlist_externals =
mkdir
dot
commands =
mkdir -p "{toxworkdir}/prof"
python -m cProfile -o "{toxworkdir}/prof/output.pstats" scripts/profiler.py
gprof2dot -f pstats -o "{toxworkdir}/prof/output.dot" "{toxworkdir}/prof/output.pstats"
dot -Tsvg -o "{toxworkdir}/prof/output.svg" "{toxworkdir}/prof/output.dot"
python -c 'import pathlib; print("profiler svg output under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "prof" / "output.svg"))'
[testenv:fuzz]
description = run fuzzer on testcase file
; See: https://google.github.io/oss-fuzz/
deps = atheris
commands_pre = python scripts/build_fuzzers.py {envdir}/oss-fuzz
commands = python {envdir}/oss-fuzz/infra/helper.py reproduce markdown-it-py fuzz_markdown {posargs:testcase}
|