File: conftest.py

package info (click to toggle)
pytest-black 0.6.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 156 kB
  • sloc: python: 206; makefile: 5
file content (20 lines) | stat: -rw-r--r-- 310 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import importlib

import pytest


pytest_plugins = "pytester"


@pytest.fixture
def black_available():
    pytest.importorskip('black')


@pytest.fixture
def black_unavailable():
    try:
        importlib.import_module('black')
        pytest.skip("Black is available")
    except ImportError:
        return