diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-06-06 23:27:02 -0400 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-06-06 23:27:02 -0400 |
commit | 6cdf70823b344b99d6623af19fb618a9c2dbdad4 (patch) | |
tree | bede2cb855afa16facd5c92832ce06795d88ad2f /cmd2/transcript.py | |
parent | abeb8e7cabec6b18c269debb74659f91df4f6058 (diff) | |
download | cmd2-git-6cdf70823b344b99d6623af19fb618a9c2dbdad4.tar.gz |
Refactored how and when transcript file glob patterns are expanded in order to present a better error message to user
Diffstat (limited to 'cmd2/transcript.py')
-rw-r--r-- | cmd2/transcript.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/cmd2/transcript.py b/cmd2/transcript.py index b5cb5397..b507cbf2 100644 --- a/cmd2/transcript.py +++ b/cmd2/transcript.py @@ -10,7 +10,6 @@ This file contains the classess necessary to make that work. These classes are used in cmd2.py::run_transcript_tests() """ import re -import glob import unittest from typing import Tuple @@ -30,13 +29,10 @@ class Cmd2TestCase(unittest.TestCase): def fetchTranscripts(self): self.transcripts = {} - for fileset in self.cmdapp.testfiles: - for fname in glob.glob(fileset): - tfile = open(fname) - self.transcripts[fname] = iter(tfile.readlines()) - tfile.close() - if not len(self.transcripts): - raise Exception("No test files found - nothing to test.") + for fname in self.cmdapp.testfiles: + tfile = open(fname) + self.transcripts[fname] = iter(tfile.readlines()) + tfile.close() def setUp(self): if self.cmdapp: |