mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-04 14:08:22 +02:00
linux: Provide temporary history directory in tests
This avoids a warning when history files need to be saved.
This commit is contained in:
parent
f2da5678f3
commit
7f846bcee6
1 changed files with 4 additions and 0 deletions
|
|
@ -21,6 +21,7 @@ import os
|
|||
import sys
|
||||
import dbus
|
||||
import tempfile
|
||||
import shutil
|
||||
import subprocess
|
||||
import unittest
|
||||
import time
|
||||
|
|
@ -191,6 +192,9 @@ class Tests(dbusmock.DBusTestCase):
|
|||
if not cfgfile:
|
||||
_, cfgfile = tempfile.mkstemp(prefix='upower-cfg-')
|
||||
self.addCleanup(os.unlink, cfgfile)
|
||||
env['UPOWER_CONF_FILE_NAME'] = cfgfile
|
||||
env['UPOWER_HISTORY_DIR'] = tempfile.mkdtemp(prefix='upower-history-')
|
||||
self.addCleanup(shutil.rmtree, env['UPOWER_HISTORY_DIR'])
|
||||
env['G_DEBUG'] = 'fatal-criticals'
|
||||
# note: Python doesn't propagate the setenv from Testbed.new(), so we
|
||||
# have to do that ourselves
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue