Does anyone know what the motivation is for the di...
# development
h
Does anyone know what the motivation is for the distinction between
FakeOptionValues
and
OptionValuesContainer
?
a
one of them is more mockable
and used in testing
h
the old roots test is passing in an instance of
FakeOptionValues
to the
SourceRoot
, but my new one is passing in
OptionValuesContainer
so maybe i need to be mocking a
FakeOptionValues
somehow?
this is in
source_root.py
, in
create_trie()
a
what do you need an
OptionValuesContainer
for?
the pants test framework is creating the
FakeOptionValues
for you
h
if I print the result of
self.get_options()
in
create_trie
when I run my new test, it's a value of type
OptionsValueContainer
, not of
FakeOptionValues
in the v1 test that is
FakeOptionValues
a
yes
it looks like v2 may make it easier to mock things like options and require fewer hacks
h
so somehow I'm not setting the options that I need in teh v2 test
a
what options do you need?
h
I think what the old test is doing is setting
--source-source-root
that call to
set_option_for_scope
is equivalent to passing
--source-source-root
at the command line, right?
a
that’s correct!
sometimes some options have different precedences when the option is specified via the config file / command line / environment so be aware of that but i don’t think that’s relevant in this case