Skip to content

Commit ce6b22e

Browse files
Only mock when True is passed to Driver.run.
* sphinx_polyversion/driver.py (Driver.run)
1 parent de8a71d commit ce6b22e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

sphinx_polyversion/driver.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
Generic,
2323
Iterable,
2424
List,
25-
Literal,
2625
Mapping,
2726
Tuple,
2827
Type,
@@ -91,7 +90,7 @@ def __init__(
9190
root: Path,
9291
output_dir: Path,
9392
*,
94-
mock: MockData[RT] | None | Literal[False] = None,
93+
mock: MockData[RT] | None = None,
9594
) -> None:
9695
"""
9796
Init the driver.
@@ -350,9 +349,9 @@ async def arun(self) -> None:
350349
await asyncio.gather(*(self.build_revision(rev) for rev in self.targets))
351350
await self.build_root()
352351

353-
def run(self) -> None:
352+
def run(self, mock: bool = False) -> None:
354353
"""Build all revisions or build from local files."""
355-
if self.mock:
354+
if mock:
356355
asyncio.run(self.build_local())
357356
else:
358357
asyncio.run(self.arun())
@@ -429,7 +428,7 @@ def __init__(
429428
encoder: Encoder | None = None,
430429
static_dir: StrPath | None = None,
431430
template_dir: StrPath | None = None,
432-
mock: MockData[JRT] | None | Literal[False] = None,
431+
mock: MockData[JRT] | None = None,
433432
) -> None:
434433
"""
435434
Init the driver.

0 commit comments

Comments
 (0)