typeddjango / pytest-mypy-plugins

pytest plugin for testing mypy types, stubs, and plugins
https://pypi.org/project/pytest-mypy-plugins/
MIT License
102 stars 24 forks source link

Add `mark` support #32

Open sobolevn opened 4 years ago

sobolevn commented 4 years ago

Sometimes I want to run all FutureResult (or tests for any other type) related tests from returns. It is a very complex task right now.

I need to:

  1. manually find all FutureResult inside tests
  2. manually copy all the paths from the query
  3. provide long list of arguments to pytest

All I want instead is:

- case: test_future_result
   marks:
     - future_result
  main: ...

And then pytest -m future_result to run this (and all other similarly marked tests).

kornicameister commented 4 years ago

Can be done, but marks on its own can have parameters i.e. mode(mode_name) where mode_name is a placeholder. Any idea for possible syntax to support that?

Also...pytest warns if you use undefined mark; but I guess that has to stay. You define a mark and later on can use the mark either in yml or py test file, right?

sobolevn commented 4 years ago

Any idea for possible syntax to support that?

No ideas! Do you have any?

kornicameister commented 4 years ago

Dunno :P I guess something to resemble normal pytest should be most efficient:

- case: lol
  mark:
    - blockchain
    - module(api)

pytest:ini

[pytest]
marks = 
   blockchain: ...
   module(m): ...

?