Skip to content

Commit

Permalink
Fix the examples test.
Browse files Browse the repository at this point in the history
  • Loading branch information
rudolfbyker committed Aug 22, 2023
1 parent afef6a8 commit 96f7c40
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
1 change: 0 additions & 1 deletion examples/example1/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ plugins:
- mkdocstrings:
handlers:
vba: { }
python: { }
16 changes: 6 additions & 10 deletions test/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from contextlib import contextmanager
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import Generator

from locate import this_dir
from mkdocs.commands.build import build
Expand All @@ -12,18 +13,14 @@


@contextmanager
def tmp_build(config_file_path: Path):
with TemporaryDirectory() as tmp_dir:
tmp_dir = Path(tmp_dir)
def tmp_build(config_file_path: Path) -> Generator[Path, None, None]:
with TemporaryDirectory() as tmp_dir_str:
tmp_dir = Path(tmp_dir_str)

with config_file_path.open(mode="rb") as f:
config = load_config(config_file=f)
config["site_dir"] = tmp_dir
build(
config=config,
dirty=False,
live_server=False,
)
build(config=config)

try:
yield tmp_dir
Expand All @@ -33,9 +30,8 @@ def tmp_build(config_file_path: Path):

class TestExamples(unittest.TestCase):
def test_example1(self):
raise unittest.SkipTest

with tmp_build(examples_dir.joinpath("example1", "mkdocs.yml")) as tmp_dir:
# TODO: Write assertions. For now, just check that it does not fail.
pass


Expand Down

0 comments on commit 96f7c40

Please sign in to comment.