File: conftest.py

package info (click to toggle)
python-confection 1.0.0~dev0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 260 kB
  • sloc: python: 2,588; sh: 13; makefile: 4
file content (24 lines) | stat: -rw-r--r-- 489 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import pytest


def pytest_addoption(parser):
    parser.addoption("--slow", action="store_true", help="include slow tests")


@pytest.fixture()
def pathy_fixture():
    pytest.importorskip("pathy")
    import shutil
    import tempfile

    from pathy import Pathy, use_fs

    temp_folder = tempfile.mkdtemp(prefix="thinc-pathy")
    use_fs(temp_folder)

    root = Pathy("gs://test-bucket")
    root.mkdir(exist_ok=True)

    yield root
    use_fs(False)
    shutil.rmtree(temp_folder)