Update advice about _called_from_test.#6168
Update advice about _called_from_test.#6168nicoddemus merged 1 commit intopytest-dev:masterfrom shields-fn:patch-1
Conversation
RonnyPfannschmidt
left a comment
There was a problem hiding this comment.
as we dont have a executing example yet this is fine as is, but we should follow up with an actual execution at a later point
| else: | ||
| # called "normally" | ||
| ... | ||
|
|
There was a problem hiding this comment.
i noted that we haven't yet a actual example execution block, so this example isn't actually executed demoing the effect -
There was a problem hiding this comment.
How do I do that?
There was a problem hiding this comment.
TBH I think the current example is fine, it is a really contrived use case anyways. 🤷♂
asottile
left a comment
There was a problem hiding this comment.
I think this is mergeable as is but will defer clicking the button until @RonnyPfannschmidt has had additional input 👍
|
We should squash the commits before merging as well. |
Instead of giving an example of using sys and then, at the end, advising not to use sys, just give a correct example. This is especially helpful since mypy 0.740 has started (correctly) complaining about sys._called_from_pytest not being present.
|
please merge, having it as runner example take a bit of tinkering |

Instead of giving an example of using
sysand then, at the end, advising to not usesys, just give a preferred example. This is especially helpful since mypy 0.740 has started (correctly) complaining aboutsys._called_from_testnot being present.