You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe. Patcher accepts modules_to_reload as a list of modules to reload. However, additional_skip_names is a set of str. This is mildly inconsistent.
Failure to correctly configure these values results in strange errors deeper down the stack, when the test actually runs. It feels like unnecessary friction and confusion to get the setup just right.
Describe the solution you'd like
How about if additional_skip_names was a list of modules? Internally, the list of modules could be converted to list of str:
Hm, first, this is a feature that is rarely used (out of interest - what do you need it for?).
Secondly, using strings means you don't have to load the modules, so I'm reluctant to change this in general. Your proposal to accept both modules and module names is a good compromise, though.
I'm adding a TTL file cache and am using pendulum to do datetime logic. I use pyfakefs to create the cache in a unit test. pendulum.now() reads both /etc/localtime as well as its packaged tz database files and doesn't work unless allowed to access the real filesystem.
No, it should not be a problem - I just don't want to force the user to import it, and want to remain upwards-compatible. Anyway, as I said, I'm changing it to accept both modules and module names .
Is your feature request related to a problem? Please describe.
Patcher
acceptsmodules_to_reload
as a list of modules to reload. However,additional_skip_names
is a set ofstr
. This is mildly inconsistent.https://github.com/jmcgeheeiv/pyfakefs/blob/f1cc61553f5e87b4139fb2cdaa2130b4dcc29bae/pyfakefs/fake_filesystem_unittest.py#L309-L315
Failure to correctly configure these values results in strange errors deeper down the stack, when the test actually runs. It feels like unnecessary friction and confusion to get the setup just right.
Describe the solution you'd like
How about if
additional_skip_names
was a list of modules? Internally, the list of modules could be converted to list of str:Could also accept both strings or modules.
The text was updated successfully, but these errors were encountered: