Merge pkg_resources workaround

Merge branch 'pkg_resources_bugfix' of github.com:raquel-ucl/pytest into pkg-resources

This is an odd case and doesn't really make sense, it is working around a bug
in maven/jython and the old version or weird packaging of setuptools they use.
But we used to do this in the past so might as well keep doing this.
This commit is contained in:
Floris Bruynooghe 2016-09-19 10:14:41 +01:00
commit f484e7c9ca
3 changed files with 4 additions and 4 deletions

View File

@ -106,6 +106,7 @@ Punyashloka Biswal
Quentin Pradet Quentin Pradet
Ralf Schmitt Ralf Schmitt
Raphael Pierzina Raphael Pierzina
Raquel Alegre
Roberto Polli Roberto Polli
Romain Dorgueil Romain Dorgueil
Roman Bolshakov Roman Bolshakov

View File

@ -5,13 +5,12 @@
in Python 2 (`#1905`_). in Python 2 (`#1905`_).
Thanks `@philpep`_ for the report and `@nicoddemus`_ for the PR. Thanks `@philpep`_ for the report and `@nicoddemus`_ for the PR.
*
* Assertions are now being rewritten for plugins in development mode * Assertions are now being rewritten for plugins in development mode
(``pip install -e``) (`#1934`_). (``pip install -e``) (`#1934`_).
Thanks `@nicoddemus`_ for the PR. Thanks `@nicoddemus`_ for the PR.
* * Fix pkg_resources import error in Jython projects (`#1853`).
Thanks `@raquel-ucl`_ for the PR.
* *

View File

@ -5,7 +5,6 @@ import traceback
import types import types
import warnings import warnings
import pkg_resources
import py import py
# DON't import pytest here because it causes import cycle troubles # DON't import pytest here because it causes import cycle troubles
import sys, os import sys, os
@ -952,6 +951,7 @@ class Config(object):
except SystemError: except SystemError:
mode = 'plain' mode = 'plain'
else: else:
import pkg_resources
self.pluginmanager.rewrite_hook = hook self.pluginmanager.rewrite_hook = hook
for entrypoint in pkg_resources.iter_entry_points('pytest11'): for entrypoint in pkg_resources.iter_entry_points('pytest11'):
# 'RECORD' available for plugins installed normally (pip install) # 'RECORD' available for plugins installed normally (pip install)