Skip to content

Commit 25382ce

Browse files
author
Anton Zuev
committed
Update tests/bugs/gh_8485_test.py to demonstrate the use of a new store_config fixture.
1 parent 1933458 commit 25382ce

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

tests/bugs/gh_8485_test.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,14 @@
3535
"""
3636

3737
@pytest.mark.version('>=3.0.13')
38-
def test_1(act: Action, tmp_file: Path, capsys):
38+
def test_1(act: Action, tmp_file: Path, store_config: ConfigManager, capsys):
3939

40+
store_config.replace('databases.conf', WRONG_DBCONF)
4041
try:
41-
shutil.copy2(act.home_dir/'databases.conf', tmp_file)
42-
with open(act.home_dir/'databases.conf', 'w') as f:
43-
f.write(WRONG_DBCONF)
4442
act.isql(switches = ['-q'], input = f'connect {act.db.dsn};', combine_output = True)
4543
except Error as e:
4644
# Despite crash, no messages were issued here before fix.
4745
print(e)
48-
finally:
49-
shutil.copy2(tmp_file, act.home_dir/'databases.conf')
5046

5147
for line in act.stdout.splitlines():
5248
if (pos := line.lower().find('databases.conf')) > 0:

0 commit comments

Comments
 (0)