File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change 1
- # -*- coding: utf-8 -*-
2
- from __future__ import print_function
3
-
4
1
import fnmatch
5
2
import os
6
3
from pprint import pformat
7
4
8
- import pkg_resources
9
- from pkg_resources import DistributionNotFound
10
-
11
- __version__ = '1.7.1'
5
+ import pytest
12
6
13
7
14
8
def get_installed_distributions ():
15
9
"""
16
10
Return a list of installed Distribution objects.
17
11
"""
18
- return [d for d in pkg_resources .working_set ]
12
+ try :
13
+ import pkg_resources
14
+ return [d for d in pkg_resources .working_set ]
15
+ except (ImportError , AttributeError , TypeError ):
16
+ pass
19
17
20
18
21
19
def get_attr (obj , attr , default = 'NOT FOUND' ):
@@ -126,7 +124,7 @@ def _get_version(package_name):
126
124
import pkg_resources
127
125
128
126
return pkg_resources .require (package_name )[0 ].version
129
- except (ImportError , AttributeError , TypeError , DistributionNotFound ):
127
+ except (ImportError , AttributeError , TypeError ):
130
128
pass
131
129
132
130
try :
@@ -168,6 +166,7 @@ def pytest_report_header(config):
168
166
return "\n " .join (ret )
169
167
170
168
169
+ @pytest .hookimpl ()
171
170
def pytest_addoption (parser ):
172
171
group = parser .getgroup ("general" )
173
172
group .addoption ('--echo-env' , action = 'append' , dest = "echo_envs" ,
You can’t perform that action at this time.
0 commit comments