mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Cleanup after unit tests (#3277)
Close https://github.com/patroni/patroni/issues/3276
This commit is contained in:
+5
-1
@@ -252,7 +252,8 @@ class PostgresInit(unittest.TestCase):
|
||||
@patch.object(ConfigHandler, 'replace_pg_ident', Mock())
|
||||
@patch.object(Postgresql, 'get_postgres_role_from_data_directory', Mock(return_value='primary'))
|
||||
def setUp(self):
|
||||
data_dir = os.path.join('data', 'test0')
|
||||
self._tmp_dir = 'data'
|
||||
data_dir = os.path.join(self._tmp_dir, 'test0')
|
||||
config = {'name': 'postgresql0', 'scope': 'batman', 'data_dir': data_dir,
|
||||
'config_dir': data_dir, 'retry_timeout': 10,
|
||||
'krbsrvname': 'postgres', 'pgpass': os.path.join(data_dir, 'pgpass0'),
|
||||
@@ -293,3 +294,6 @@ class BaseTestPostgresql(PostgresInit):
|
||||
def tearDown(self):
|
||||
if os.path.exists(self.p.data_dir):
|
||||
shutil.rmtree(self.p.data_dir)
|
||||
|
||||
if not os.listdir(self._tmp_dir):
|
||||
shutil.rmtree(self._tmp_dir)
|
||||
|
||||
Reference in New Issue
Block a user