Skip to content

Conversation

@ElenaDru
Copy link
Owner

@ElenaDru ElenaDru commented Sep 23, 2023

Переход к домашке второй недели:

  • пофикшен сид

Сделала пул реквест чтобы не забыть до дедлайна, ушла обратно делать вторую домашку
Если будут значительные апдейты по домашке - добавлю в список)

return registration_data_factory()


@pytest.mark.parametrize('page', [
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

советуют физические пути к url заменять на конструкции reverse('identity:login"), т.к. лучше привизываться к именам, а не к hardcoded путям. Так тесты становятся менее хрупкими

def pytest_configure(config: pytest.Config) -> None:
"""Create or restore random value to be used as seed during tests."""
seed_value = config.getoption('randomly_seed')
default_seed = random.Random().getrandbits(random_seed)
Copy link

@balancy balancy Sep 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не очень логично называть переменную, которую ты используешь в качестве размерности сгенерированного случайного числа, random_seed, т.к. seed у тебя вычисляется дальше. Можно было назвать как-нибудь типа random_seed_length

@teddybear
Copy link

Я полазил посмотрел по коду, стало интересно, откуда в этой фикстуре

@pytest.fixture()
def user_data_factory(field: Field) -> UserDataFactory:

приходит field? Это какая-то библиотека добавляет? Просто самого объявления нет, а mimesis вроде сам их не дает, стало интересно, кто такую предоставляет, удобненько =)



@pytest.fixture(scope='session')
def field() -> Field:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А, все, увидел, круто =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants