File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
development_guide/contributor_guide/tests Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,23 @@ test runner. The following options are currently supported:
6666- "except_implementations": List of python implementations on which the test should not run
6767- "exclude_platforms": List of operating systems on which the test should not run
6868
69+ **Different output for different Python versions **
70+
71+ Sometimes the linting result can change between Python releases. In these cases errors can be marked as conditional.
72+ Supported operators are ``< ``, ``<= ``, ``> `` and ``>= ``.
73+
74+ def some_func() -> X: # <3.14:[undefined-variable]
75+ ...
76+
77+ class X: ...
78+
79+ Since the output messages are different, it is necessary to add two separate files for it.
80+ First ``<test-file-name>.314.txt ``, this will include the output messages for ``>=3.14 ``, i.e. should be empty here.
81+ Second ``<test-file-name>.txt ``, this will be the default for all other Python versions.
82+
83+ Note, this does only work if the code itself is valid in all tested Python versions.
84+ For new syntax, use ``min_pyver `` / ``max_pyver `` instead.
85+
6986**Functional test file locations **
7087
7188For existing checkers, new test cases should preferably be appended to the existing test file.
Original file line number Diff line number Diff line change 1+ Modified test framework to allow for different test output for different Python versions.
2+
3+ Refs #10382
You can’t perform that action at this time.
0 commit comments