File tree 2 files changed +20
-0
lines changed
development_guide/contributor_guide/tests
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:
66
66
- "except_implementations": List of python implementations on which the test should not run
67
67
- "exclude_platforms": List of operating systems on which the test should not run
68
68
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
+
69
86
**Functional test file locations **
70
87
71
88
For 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