Skip to content

Create a util module in tests to share common test functionality #223

@daniel-zullo-frequenz

Description

@daniel-zullo-frequenz

What's needed?

The following function is duplicated in a couple of test modules

@pytest.fixture
def fake_time() -> Iterator[time_machine.Coordinates]:
    """Replace real time with a time machine that doesn't automatically tick."""
    with time_machine.travel(0, tick=False) as traveller:
        yield traveller

Proposed solution

Move that common/shared functionality into a new module so tests that needed can use it rather than duplicating it.

Use cases

This is just to avoid code redundancy/duplication in tests.

Alternatives and workarounds

No response

Additional context

No response

Metadata

Metadata

Labels

part:testsAffects the unit, integration and performance (benchmarks) testspriority:lowThis should be addressed only if there is nothing else on the tabletype:enhancementNew feature or enhancement visitble to users

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions