mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Ensure tweaks are set to default when running tests
This commit is contained in:
parent
7819f37a45
commit
064294fa32
@ -21,6 +21,11 @@ class BaseTest(unittest.TestCase):
|
||||
longMessage = True
|
||||
maxDiff = None
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
from calibre.utils.config_base import reset_tweaks_to_default
|
||||
reset_tweaks_to_default()
|
||||
|
||||
def setUp(self):
|
||||
self.library_path = self.mkdtemp()
|
||||
self.create_db(self.library_path)
|
||||
|
@ -474,4 +474,11 @@ def write_tweaks(raw):
|
||||
|
||||
tweaks = read_tweaks()
|
||||
|
||||
def reset_tweaks_to_default():
|
||||
global tweaks
|
||||
default_tweaks = P('default_tweaks.py', data=True,
|
||||
allow_user_override=False)
|
||||
dl, dg = {}, {}
|
||||
exec default_tweaks in dg, dl
|
||||
tweaks = dl
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user