Skip to content

Commit 6abdead

Browse files
author
Buck Golemon
committed
an ugly patch to fix all but the most important part =/
1 parent 160102c commit 6abdead

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

_pytest/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ def cwd_relative_nodeid(self, nodeid):
878878
def fromdictargs(cls, option_dict, args):
879879
""" constructor useable for subprocesses. """
880880
config = get_config()
881-
config._preparse(args, addopts=False)
881+
config.parse(args, addopts=False)
882882
config.option.__dict__.update(option_dict)
883883
for x in config.option.plugins:
884884
config.pluginmanager.consider_pluginarg(x)
@@ -946,14 +946,14 @@ def _checkversion(self):
946946
self.inicfg.config.path, self.inicfg.lineof('minversion'),
947947
minver, pytest.__version__))
948948

949-
def parse(self, args):
949+
def parse(self, args, addopts=True):
950950
# parse given cmdline arguments into this config object.
951951
assert not hasattr(self, 'args'), (
952952
"can only parse cmdline args at most once per Config object")
953953
self._origargs = args
954954
self.hook.pytest_addhooks.call_historic(
955955
kwargs=dict(pluginmanager=self.pluginmanager))
956-
self._preparse(args)
956+
self._preparse(args, addopts=addopts)
957957
# XXX deprecated hook:
958958
self.hook.pytest_cmdline_preparse(config=self, args=args)
959959
args = self._parser.parse_setoption(args, self.option)

testing/test_config.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ def pytest_addoption(parser):
266266

267267

268268
class TestConfigFromdictargs:
269-
@pytest.mark.xfail(reason="fromdictargs currently broken #1060")
270269
def test_basic_behavior(self):
271270
from _pytest.config import Config
272271
option_dict = {
@@ -282,7 +281,6 @@ def test_basic_behavior(self):
282281
assert config.option.foo == 'bar'
283282
assert config.args == args
284283

285-
@pytest.mark.xfail(reason="fromdictargs currently broken #1060")
286284
def test_origargs(self):
287285
"""Show that fromdictargs can handle args in their "orig" format"""
288286
from _pytest.config import Config

0 commit comments

Comments
 (0)