From 2f11a8569806933a0e585a576e6e6af652ae6bfb Mon Sep 17 00:00:00 2001 From: Raquel Alegre Date: Tue, 23 Aug 2016 16:41:11 +0100 Subject: [PATCH] Import pkg_resources only when necessary. --- _pytest/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_pytest/config.py b/_pytest/config.py index 2a1215811..a401bb068 100644 --- a/_pytest/config.py +++ b/_pytest/config.py @@ -5,7 +5,6 @@ import traceback import types import warnings -import pkg_resources import py # DON't import pytest here because it causes import cycle troubles import sys, os @@ -942,6 +941,7 @@ class Config(object): and find all the installed plugins to mark them for re-writing by the importhook. """ + import pkg_resources ns, unknown_args = self._parser.parse_known_and_unknown_args(args) mode = ns.assertmode if mode == 'rewrite':