FIx random test failure if certain files exist
This commit is contained in:
parent
afaac92685
commit
de727645ab
@ -743,18 +743,18 @@ def test_set_loggers_journald_importerror(mocker, import_fails):
|
|||||||
logger.handlers = orig_handlers
|
logger.handlers = orig_handlers
|
||||||
|
|
||||||
|
|
||||||
def test_set_logfile(default_conf, mocker):
|
def test_set_logfile(default_conf, mocker, tmpdir):
|
||||||
patched_configuration_load_config_file(mocker, default_conf)
|
patched_configuration_load_config_file(mocker, default_conf)
|
||||||
|
f = Path(tmpdir / "test_file.log")
|
||||||
|
assert not f.is_file()
|
||||||
arglist = [
|
arglist = [
|
||||||
'trade', '--logfile', 'test_file.log',
|
'trade', '--logfile', str(f),
|
||||||
]
|
]
|
||||||
args = Arguments(arglist).get_parsed_arg()
|
args = Arguments(arglist).get_parsed_arg()
|
||||||
configuration = Configuration(args)
|
configuration = Configuration(args)
|
||||||
validated_conf = configuration.load_config()
|
validated_conf = configuration.load_config()
|
||||||
|
|
||||||
assert validated_conf['logfile'] == "test_file.log"
|
assert validated_conf['logfile'] == str(f)
|
||||||
f = Path("test_file.log")
|
|
||||||
assert f.is_file()
|
assert f.is_file()
|
||||||
try:
|
try:
|
||||||
f.unlink()
|
f.unlink()
|
||||||
|
Loading…
Reference in New Issue
Block a user