Skip to content

Commit f484e7c

Browse files
committed
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.
2 parents 2bafa74 + 8f516d2 commit f484e7c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ Punyashloka Biswal
106106
Quentin Pradet
107107
Ralf Schmitt
108108
Raphael Pierzina
109+
Raquel Alegre
109110
Roberto Polli
110111
Romain Dorgueil
111112
Roman Bolshakov

CHANGELOG.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
in Python 2 (`#1905`_).
66
Thanks `@philpep`_ for the report and `@nicoddemus`_ for the PR.
77

8-
*
9-
108
* Assertions are now being rewritten for plugins in development mode
119
(``pip install -e``) (`#1934`_).
1210
Thanks `@nicoddemus`_ for the PR.
1311

14-
*
12+
* Fix pkg_resources import error in Jython projects (`#1853`).
13+
Thanks `@raquel-ucl`_ for the PR.
1514

1615
*
1716

_pytest/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import types
66
import warnings
77

8-
import pkg_resources
98
import py
109
# DON't import pytest here because it causes import cycle troubles
1110
import sys, os
@@ -952,6 +951,7 @@ def _consider_importhook(self, args, entrypoint_name):
952951
except SystemError:
953952
mode = 'plain'
954953
else:
954+
import pkg_resources
955955
self.pluginmanager.rewrite_hook = hook
956956
for entrypoint in pkg_resources.iter_entry_points('pytest11'):
957957
# 'RECORD' available for plugins installed normally (pip install)

0 commit comments

Comments
 (0)