Skip to content

Commit

Permalink
Conditionally ignore cleanup errors in newer versions of python tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Campbell committed May 10, 2024
1 parent 134997d commit 2a9d47a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@
from pathlib import Path

import pytest

import sys
from rumydata.field import Text, Integer, Date, Choice


@pytest.fixture()
@pytest.mark.skipif(sys.version_info >= (3, 10))
def tmpdir():
with tempfile.TemporaryDirectory() as d:
yield Path(d)

@pytest.mark.skipif(sys.version_info < (3, 10))
def tmpdir():
with tempfile.TemporaryDirectory(ignore_cleanup_errors=True) as d:
yield Path(d)

@pytest.fixture()
def basic() -> dict:
Expand Down

0 comments on commit 2a9d47a

Please sign in to comment.