Skip to content

Commit a8365cb

Browse files
author
Sylvain MARIE
committed
Disabling pycharm-related hack when not needed.
1 parent cde1f3d commit a8365cb

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

pytest_cases/tests/meta/test_all.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,9 @@ def test_run_all_tests(test_to_run, testdir):
8585
# protect against pycharm fiddling with the config
8686
from _pytest import config
8787
jb_prepareconfig = config._prepareconfig
88-
89-
_real_prepare_config = get_pytest_prepare_config()
90-
91-
def real_prepare_config(args=None, plugins=None):
92-
cfg_to_use = _real_prepare_config(args, plugins)
93-
jb_config_results = jb_prepareconfig(None, None)
94-
return cfg_to_use
95-
96-
config._prepareconfig = real_prepare_config
88+
if jb_prepareconfig.__module__ != config.get_config.__module__:
89+
# we are in pycharm ! Fix that
90+
config._prepareconfig = get_pytest_prepare_config()
9791

9892
# run
9993
# first = testdir.runpytest("--collect-only", "-p", "no:cacheprovider") # ("-q")

0 commit comments

Comments
 (0)