forked from conda/conda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconftest.py
30 lines (20 loc) · 773 Bytes
/
conftest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import sys
import warnings
import pytest
from conda.common.compat import PY3
win_default_shells = ["cmd.exe", "powershell", "git_bash", "cygwin"]
shells = ["bash", "zsh"]
if sys.platform == "win32":
shells = win_default_shells
def pytest_addoption(parser):
parser.addoption("--shell", action="append", default=[],
help="list of shells to run shell tests on")
def pytest_generate_tests(metafunc):
if 'shell' in metafunc.fixturenames:
metafunc.parametrize("shell", metafunc.config.option.shell)
@pytest.fixture()
def suppress_resource_warning():
# suppress unclosed socket warning
# https://github.com/kennethreitz/requests/issues/1882
if PY3:
warnings.filterwarnings("ignore", category=ResourceWarning)