Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions tests/test_plugin.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
from unittest.mock import Mock

import pytest

from pytest_isort import FileIgnorer, IsortError, IsortItem


pytest_plugins = ('pytester',)


def get_pytest_version():
return tuple(map(int, pytest.__version__.split('.')))


def test_version():
import pytest_isort

Expand Down Expand Up @@ -189,10 +183,10 @@ class TestParent:
parent = TestParent()
path = testdir.tmpdir

if get_pytest_version()[0] < 5:
test_obj = IsortItem(path, parent)
else:
if hasattr(IsortItem, "from_parent"):
test_obj = IsortItem.from_parent(parent, fspath=path)
else:
test_obj = IsortItem(path, parent)

assert test_obj.name == path.basename
assert test_obj.parent == parent
Expand Down