Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
tabatkins committed Jul 28, 2023
1 parent 82444e6 commit f39cbe6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bikeshed/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ def handleTest(options: argparse.Namespace, extras: list[str]) -> None:

md = metadata.fromCommandLine(extras)
constants.setErrorLevel("nothing")
constants.quiet = 100
#constants.quiet = 100
filters = test.TestFilter.fromOptions(options)
if options.rebase:
test.rebase(filters, md=md)
Expand Down
18 changes: 13 additions & 5 deletions bikeshed/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import glob
import os
import re
import sys

from alive_progress import alive_it

Expand Down Expand Up @@ -136,13 +137,20 @@ def processTest(
fileRequester: t.DataFileRequester = retrieve.DataFileRequester(fileType="readonly"),
) -> t.SpecT:
try:
doc = Spec(inputFilename=path, fileRequester=fileRequester, testing=True)
if md is not None:
doc.mdCommandLine = md
addTestMetadata(doc)
doc.preprocess()
messagesFilename = path[:-2] + "console.txt"
oldStdout = sys.stdout
doc = None
with open(messagesFilename, "w", encoding="utf-8") as fh:
sys.stdout = fh
doc = Spec(inputFilename=path, fileRequester=fileRequester, testing=True)
if md is not None:
doc.mdCommandLine = md
addTestMetadata(doc)
doc.preprocess()
sys.stdout = oldStdout
except Exception as e:
m.p(f"Error running test {path}:\n {e}")
assert doc is not None
return doc


Expand Down

0 comments on commit f39cbe6

Please sign in to comment.