PYTHONL Telegram 5047
Монолитные тесты = больше головной боли при отладке.
Когда в одном тесте проверяешь всё подряд, при падении непонятно, какой именно сценарий сломался.

Пишем специфичные тесты.
Каждая функция тестирует один конкретный случай. Так при падении сразу видно, где ошибка.

Плохо:

def test_extract_sentiment():
assert extract_sentiment("I love this!") == "positive"
assert extract_sentiment("Terrible") == "negative"
assert extract_sentiment("On time") == "neutral"


Хорошо:

def test_extract_sentiment_positive():
assert extract_sentiment("I love this!") == "positive"

def test_extract_sentiment_negative():
assert extract_sentiment("Terrible") == "negative"


📌 Результат — быстрее находишь баги и не тратишь время на догадки.
👍1211🔥4



tgoop.com/pythonl/5047
Create:
Last Update:

Монолитные тесты = больше головной боли при отладке.
Когда в одном тесте проверяешь всё подряд, при падении непонятно, какой именно сценарий сломался.

Пишем специфичные тесты.
Каждая функция тестирует один конкретный случай. Так при падении сразу видно, где ошибка.

Плохо:


def test_extract_sentiment():
assert extract_sentiment("I love this!") == "positive"
assert extract_sentiment("Terrible") == "negative"
assert extract_sentiment("On time") == "neutral"


Хорошо:

def test_extract_sentiment_positive():
assert extract_sentiment("I love this!") == "positive"

def test_extract_sentiment_negative():
assert extract_sentiment("Terrible") == "negative"


📌 Результат — быстрее находишь баги и не тратишь время на догадки.

BY Python/ django




Share with your friend now:
tgoop.com/pythonl/5047

View MORE
Open in Telegram


Telegram News

Date: |

With the sharp downturn in the crypto market, yelling has become a coping mechanism for many crypto traders. This screaming therapy became popular after the surge of Goblintown Ethereum NFTs at the end of May or early June. Here, holders made incoherent groaning sounds in late-night Twitter spaces. They also role-played as urine-loving Goblin creatures. Invite up to 200 users from your contacts to join your channel Read now Your posting frequency depends on the topic of your channel. If you have a news channel, it’s OK to publish new content every day (or even every hour). For other industries, stick with 2-3 large posts a week. Telegram has announced a number of measures aiming to tackle the spread of disinformation through its platform in Brazil. These features are part of an agreement between the platform and the country's authorities ahead of the elections in October.
from us


Telegram Python/ django
FROM American