mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-04-27 20:43:43 +03:00
Parameterise test
This commit is contained in:
parent
945253672a
commit
f613a9213f
|
@ -1,27 +1,14 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from PIL import _util
|
from PIL import _util
|
||||||
|
|
||||||
|
|
||||||
def test_is_path():
|
@pytest.mark.parametrize("test_path", ["filename.ext", Path("filename.ext")])
|
||||||
# Arrange
|
def test_is_path(test_path):
|
||||||
fp = "filename.ext"
|
|
||||||
|
|
||||||
# Act
|
|
||||||
it_is = _util.is_path(fp)
|
|
||||||
|
|
||||||
# Assert
|
|
||||||
assert it_is
|
|
||||||
|
|
||||||
|
|
||||||
def test_path_obj_is_path():
|
|
||||||
# Arrange
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
test_path = Path("filename.ext")
|
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
it_is = _util.is_path(test_path)
|
it_is = _util.is_path(test_path)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user