mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-01 18:01:40 +08:00
Fix test_content_generator tests by ensuring that build_log is removed before running first test
This commit is contained in:
@@ -58,6 +58,13 @@ class TestBuild(unittest.TestCase):
|
||||
self.vcr = vcr.use_cassette(filename)
|
||||
self.vcr.__enter__()
|
||||
|
||||
# Ensure that there is no build log from other tests
|
||||
try:
|
||||
path = build_logs.path(self.cg.module.id)
|
||||
os.remove(path)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
def tearDown(self):
|
||||
# Necessary to restart the twisted reactor for the next test.
|
||||
import sys
|
||||
@@ -69,7 +76,7 @@ class TestBuild(unittest.TestCase):
|
||||
try:
|
||||
path = build_logs.path(self.cg.module.id)
|
||||
os.remove(path)
|
||||
except:
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
@patch("subprocess.Popen")
|
||||
|
||||
Reference in New Issue
Block a user