-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtox.ini
100 lines (86 loc) · 3.14 KB
/
tox.ini
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
[tox]
envlist = py37,py38,py39,py310,py311
[pytest]
addopts = --ignore bin --ignore integration_tests/repos --ignore _data/
[flake8]
max-line-length = 88
extend-ignore = E203,E501
[darglint2]
strictness = short
message_template = {path}:{line}:{obj}: {msg_id} {msg}
[testenv]
deps=pytest
commands=
pytest --ignore=integration_tests/ --ignore=_data/
# Use docker environments to test all python versions.
# (This is just slightly more convenient for running tests
# without having to install a bunch of python version ahead
# of time.) I'll remove python versions as support for them
# is dropped.
[testenv:docker]
deps =
pytest
allowlist_externals =
docker
commands =
docker run -it -v {toxinidir}:/code/ darglint2-36 pytest
docker run -it -v {toxinidir}:/code/ darglint2-37 pytest
docker run -it -v {toxinidir}:/code/ darglint2-38 pytest
docker run -it -v {toxinidir}:/code/ darglint2-39 pytest
# Pre-commit tests.
#
# To run,
#
# tox -e pre-commit
#
# These tests expect certain test fixtures to be present. They're not
# included here because they could substantially increase the size of
# the repository, and I don't want to worry about licenses, etc.
#
# The following is a list of files and where they should be sourced:
#
# - _integration_tests/goldens.json_: A set of goldens which should be
# generated by hand, or using the utility in bin/doc_extract. Alternatively,
# they could be generated from darglint2 and touched up by hand to be
# made more correct.
# - _integration_tests/max_golden.json_: Should contain a very large golden,
# crafted to be difficult to parse.
# - _.performance_testrun_: Automatically generated, contains the history of
# of the performance test runs. Also used as a cache of previous runs
# to prevent pre-commit tests from taking too long.
# - _.performance_module_testrun_: Automatically generated, contains the history
# of the module performance test runs. (Which are run against the repostitories
# described below.)
# - _.performance_history_: Automatially generated, records performance history
# in an easy to view fashion.
# - _integration_tests/repos/_: Cloned whole repos to test against.
# Ideally, these will be quite large, so it doesn't make sense to include them
# in the repository.
#
# TODO: Add flake8 output.
[testenv:pre-commit]
deps=
pytest
flake8
flake8-docstrings
flake8-rst-docstrings
commands =
# E2E tests
pytest integration_tests/end_to_end.py
# Analysis tests
pytest integration_tests/analysis_tests.py
# Test against how we expect docstrings to be parsed.
pytest integration_tests/goldens.py
# Test the performance to make sure we don't introduce
# a severe regression.
pytest integration_tests/performance.py
# Test different source file encodings.
pytest integration_tests/sources.py
# Display the size of the grammar.
python integration_tests/grammar_size.py
# Display the performance statistics.
python integration_tests/performance.py
# Make sure darglint2 stays compatible with other common plugins.
pytest integration_tests/compatibility.py
# Test that the flake8 plugin gets config from flake8.
pytest integration_tests/test_flake8.py