Last active
March 14, 2022 14:34
-
-
Save jonilsonds9/2f4054ca037a90af646c7b632dbfd355 to your computer and use it in GitHub Desktop.
Como usar um valor qualquer nos asserts de testes no Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _any(cls): | |
class Any(cls): | |
def __eq__(self, other): | |
return True | |
return Any() | |
# Para usar basta chamar a função: | |
_any(str) | |
# Exemplo digamos que você quer saber se um método foi chamado com o um BufferedReader: | |
download(_any(str)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment