Skip to content

Commit

Permalink
Only mock when True is passed to Driver.run.
Browse files Browse the repository at this point in the history
* sphinx_polyversion/driver.py (Driver.run)
  • Loading branch information
real-yfprojects committed Jun 29, 2023
1 parent de8a71d commit ce6b22e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions sphinx_polyversion/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
Generic,
Iterable,
List,
Literal,
Mapping,
Tuple,
Type,
Expand Down Expand Up @@ -91,7 +90,7 @@ def __init__(
root: Path,
output_dir: Path,
*,
mock: MockData[RT] | None | Literal[False] = None,
mock: MockData[RT] | None = None,
) -> None:
"""
Init the driver.
Expand Down Expand Up @@ -350,9 +349,9 @@ async def arun(self) -> None:
await asyncio.gather(*(self.build_revision(rev) for rev in self.targets))
await self.build_root()

def run(self) -> None:
def run(self, mock: bool = False) -> None:
"""Build all revisions or build from local files."""
if self.mock:
if mock:
asyncio.run(self.build_local())
else:
asyncio.run(self.arun())
Expand Down Expand Up @@ -429,7 +428,7 @@ def __init__(
encoder: Encoder | None = None,
static_dir: StrPath | None = None,
template_dir: StrPath | None = None,
mock: MockData[JRT] | None | Literal[False] = None,
mock: MockData[JRT] | None = None,
) -> None:
"""
Init the driver.
Expand Down

0 comments on commit ce6b22e

Please sign in to comment.