Skip to content

Add migrate command #312

@MatthewMckee4

Description

@MatthewMckee4

I think this is quite a challenge to get perfect, but feels like a cool thing to do.

import pytest

@pytest.fixture
def fixture():
    return 1

Into

import karva

@karva.fixture
def fixture():
    return 1

One thing we really need to think about is import statements.

We must ensure all unused imports of pytest are removed, and that we add karva imports in the "correct" place.

I think we should always just add import karva.

I think there are some cases where we may have to migrate to karva wen the user already has some karva code.

import pytest
from karva import tags

@pytest.fixture
def fixture():
    return 1

@tags.parametrize("a", [1,2,3])
def test_something("a"): ...

But even in this example i still think we should add import karva.

Metadata

Metadata

Assignees

No one assigned

    Labels

    migrationRelated to migrating from other tools (like pytest)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions