Merge "Print name of violating file in unittest"
This commit is contained in:
@@ -88,8 +88,12 @@ class TestTitles(testtools.TestCase):
|
|||||||
def test_template(self):
|
def test_template(self):
|
||||||
files = glob.glob("guidelines/*")
|
files = glob.glob("guidelines/*")
|
||||||
for file in files:
|
for file in files:
|
||||||
self.assertTrue(file.endswith(".rst") or file.endswith(".json"),
|
if file.endswith('~'):
|
||||||
"guideline files must use 'rst' or 'json' extension.")
|
continue
|
||||||
|
self.assertTrue(
|
||||||
|
file.endswith(".rst") or file.endswith(".json"),
|
||||||
|
"guideline file must use 'rst' or 'json'"
|
||||||
|
"extension: {file}".format(file=file))
|
||||||
with open(file) as f:
|
with open(file) as f:
|
||||||
data = f.read()
|
data = f.read()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user