Skip to content

Instantly share code, notes, and snippets.

@jonilsonds9
Last active March 14, 2022 14:34
Show Gist options
  • Save jonilsonds9/2f4054ca037a90af646c7b632dbfd355 to your computer and use it in GitHub Desktop.
Save jonilsonds9/2f4054ca037a90af646c7b632dbfd355 to your computer and use it in GitHub Desktop.
Como usar um valor qualquer nos asserts de testes no Python
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