[//]: # (
. Note: for support questions, please use Stackoverflow or Gitter.
. This repository's issues are reserved for feature requests and bug reports.
.
. In case of any problems with Allure Jenkins plugin please use the following repository
. to create an issue: https://github.com/jenkinsci/allure-plugin/issues
.
. Make sure you have a clear name for your issue. The name should start with a capital
. letter and no dot is required in the end of the sentence. An example of good issue names:
.
. - The report is broken in IE11
. - Add an ability to disable default plugins
. - Support emoji in test descriptions
)
I'm submitting a ...
[ ] bug report
[x] feature request
[ ] support request => Please do not submit support request here, see note at the top of this template.
What is the current behavior?
Mypy typechecker assumes that allure lib is untyped and shows various error messages.
Any method decorated with allure.step is NOT checked for typing violations (like incompatible arguments types, incompatible returning types, LSP violations in decorated methods). Theese checks just silently passes EVEN if there is something bad exists.
There is incomplete list of messages and places which theese occurs:
error: Skipping analyzing "allure": module is installed, but missing library stubs or py.typed marker [import] on import allure
error: Function is untyped after decorator transformation [misc] on any function decorated with @allure.step(...) and similars (occurs when enabled disallow-any-decorated option enabled)
error: Untyped decorator makes function {function-name} untyped [misc] on any function decorated with @allure.step(...) and similars (occurs when enabled disallow-untyped-decorators option enabled)
error: Argument {n} to {function-or-methoв-name} becomes "Any" due to an unfollowed import [no-any-unimported] on any parameter typed with thing imported from allure (occurs when enabled disallow-any-unimported option enabled)
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
And run mypy on it.
Optionaly you can enable additional options - --disallow-any-decorated, --disallow-any-unimported, --disallow-untyped-decorators
What is the expected behavior?
Since the allure sources is well-typed there is no mypy warnings in places where allure things used and allure decorators usege does not prevents detecting various violations in decorated functions.
What is the motivation / use case for changing the behavior?
Better type checking for tests.
Please tell us about your environment:
Allure version: ...
Test framework: pytest@7.2.0
Allure adaptor: allure-pytest@2.10.0
Other information
Many of theese problems just solves itself if there will py.typed file in modules, as described in PEP-561.
[//]: # (
. e.g. detailed explanation, stacktraces, related issues, suggestions
. how to fix, links for us to have more context, eg. Stackoverflow, Gitter etc
)
[//]: # ( . Note: for support questions, please use Stackoverflow or Gitter. . This repository's issues are reserved for feature requests and bug reports. . . In case of any problems with Allure Jenkins plugin please use the following repository . to create an issue: https://github.com/jenkinsci/allure-plugin/issues . . Make sure you have a clear name for your issue. The name should start with a capital . letter and no dot is required in the end of the sentence. An example of good issue names: . . - The report is broken in IE11 . - Add an ability to disable default plugins . - Support emoji in test descriptions )
I'm submitting a ...
What is the current behavior?
Mypy typechecker assumes that allure lib is untyped and shows various error messages. Any method decorated with allure.step is NOT checked for typing violations (like incompatible arguments types, incompatible returning types, LSP violations in decorated methods). Theese checks just silently passes EVEN if there is something bad exists.
There is incomplete list of messages and places which theese occurs:
error: Skipping analyzing "allure": module is installed, but missing library stubs or py.typed marker [import]
on import allureerror: Function is untyped after decorator transformation [misc]
on any function decorated with @allure.step(...) and similars (occurs when enableddisallow-any-decorated
option enabled)error: Untyped decorator makes function {function-name} untyped [misc]
on any function decorated with @allure.step(...) and similars (occurs when enableddisallow-untyped-decorators
option enabled)error: Argument {n} to {function-or-methoв-name} becomes "Any" due to an unfollowed import [no-any-unimported]
on any parameter typed with thing imported from allure (occurs when enableddisallow-any-unimported
option enabled)If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
Create file with following code:
And run mypy on it. Optionaly you can enable additional options -
--disallow-any-decorated
,--disallow-any-unimported
,--disallow-untyped-decorators
What is the expected behavior?
Since the allure sources is well-typed there is no mypy warnings in places where allure things used and allure decorators usege does not prevents detecting various violations in decorated functions.
What is the motivation / use case for changing the behavior?
Better type checking for tests.
Please tell us about your environment:
Other information
Many of theese problems just solves itself if there will
py.typed
file in modules, as described in PEP-561.[//]: # ( . e.g. detailed explanation, stacktraces, related issues, suggestions . how to fix, links for us to have more context, eg. Stackoverflow, Gitter etc )