Skip to content

Commit 96f7c40

Browse files
committed
Fix the examples test.
1 parent afef6a8 commit 96f7c40

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

examples/example1/mkdocs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ plugins:
66
- mkdocstrings:
77
handlers:
88
vba: { }
9-
python: { }

test/test_examples.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from contextlib import contextmanager
33
from pathlib import Path
44
from tempfile import TemporaryDirectory
5+
from typing import Generator
56

67
from locate import this_dir
78
from mkdocs.commands.build import build
@@ -12,18 +13,14 @@
1213

1314

1415
@contextmanager
15-
def tmp_build(config_file_path: Path):
16-
with TemporaryDirectory() as tmp_dir:
17-
tmp_dir = Path(tmp_dir)
16+
def tmp_build(config_file_path: Path) -> Generator[Path, None, None]:
17+
with TemporaryDirectory() as tmp_dir_str:
18+
tmp_dir = Path(tmp_dir_str)
1819

1920
with config_file_path.open(mode="rb") as f:
2021
config = load_config(config_file=f)
2122
config["site_dir"] = tmp_dir
22-
build(
23-
config=config,
24-
dirty=False,
25-
live_server=False,
26-
)
23+
build(config=config)
2724

2825
try:
2926
yield tmp_dir
@@ -33,9 +30,8 @@ def tmp_build(config_file_path: Path):
3330

3431
class TestExamples(unittest.TestCase):
3532
def test_example1(self):
36-
raise unittest.SkipTest
37-
3833
with tmp_build(examples_dir.joinpath("example1", "mkdocs.yml")) as tmp_dir:
34+
# TODO: Write assertions. For now, just check that it does not fail.
3935
pass
4036

4137

0 commit comments

Comments
 (0)