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
SURVIVED test_soma_0_0_deve_retornar_0: <class '_ast.Sub'> | |
SURVIVED test_soma_0_0_deve_retornar_0: <class '_ast.Mult'> | |
PASSED test_soma_0_0_deve_retornar_0: <class '_ast.Div'>. ERROR: division by zero | |
PASSED test_soma_1_1_deve_retornar_2: <class '_ast.Sub'>. ERROR: | |
PASSED test_soma_1_1_deve_retornar_2: <class '_ast.Mult'>. ERROR: | |
PASSED test_soma_1_1_deve_retornar_2: <class '_ast.Div'>. ERROR: | |
PASSED test_soma__1__1_deve_retornar__2: <class '_ast.Sub'>. ERROR: | |
PASSED test_soma__1__1_deve_retornar__2: <class '_ast.Mult'>. ERROR: | |
PASSED test_soma__1__1_deve_retornar__2: <class '_ast.Div'>. ERROR: |
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
"""Providers para o faker.""" | |
from random import choice | |
from faker import Faker | |
from faker.providers import BaseProvider | |
class Task(BaseProvider): | |
"""Model to provide tasks.""" | |
def task_name(self): |
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
from functools import singledispatch | |
from toolz import merge_with | |
dict_1 = { | |
'a': 1, | |
'b': 1, | |
'c': [ | |
1, 2, 3, 4 | |
], | |
'd': { |
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
""" | |
Behave junit merge. | |
Merge behave-junit rerun and original file | |
usage: junit-merge [-h] [--report REPORT] [--rerun_report RERUN_REPORT] | |
optional arguments: | |
-h, --help show this help message and exit | |
--report REPORT junit-file |
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
t1 = ('Eduardo', 'Mendes', 25) | |
# desempacotamos em variáveis | |
nome, sobre, idade = t1 | |
t2 = (('Eduardo', 'Mendes'), 25) | |
# desempacotamos em variáveis compostas | |
(nome, sobre), idade = t2 | |
l1 = ['Eduardo', 25, 'Martha', 'Cesar'] | |
nome, idade, mae, pai = l1 |
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
#! /bin/bash | |
#=================================================================================== | |
# | |
# Usage: | |
# ./tcr.sh -> test && commit || revert | |
# ./tcr.sh squash "my message" -> get all comits with "TCR" message squash and commit with your message | |
# | |
# Variables: | |
# code_path: production code path, not test path | |
# test_runner: choosed python test runner unittest, pytest, tox |
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
from browser import document | |
from browser.html import INPUT, LABEL, BR, FORM | |
def login_form(): | |
form = FORM( | |
Class='form login-form', | |
id="meu-forme", | |
action="#", | |
method="get", |
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
<html lang="pt-BR"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Eventos de mouse</title> | |
<script type="text/javascript" | |
src="https://cdn.jsdelivr.net/npm/[email protected]/brython.min.js"> | |
</script> | |
<script type="text/python"> | |
""" | |
Testando eventos de mouse com Brython. |
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 soma(x, y): | |
"""Função que soma dois números.""" | |
return x + y | |
def subtracao(x, y): | |
"""Função que subrai dois números.""" | |
... | |
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
from sqlite3 import connect | |
from random import randint | |
db = connect('database.sqlite') | |
cursor = db.cursor() | |
def pergunta(): |