diff --git a/Makefile b/Makefile index 5b8208e..2765cb4 100644 --- a/Makefile +++ b/Makefile @@ -65,6 +65,10 @@ serve-docs: $(VENV) manpage: $(VENV) help2man $(BIN)/blag --no-info -n "blog-aware, static site generator" -o debian/blag.1 +.PHONY: benchmark +benchmark: $(VENV) + $(BIN)/pytest --no-cov -rP tests/benchmark.py + .PHONY: clean clean: rm -rf build dist *.egg-info diff --git a/tests/test_markdown.py b/tests/test_markdown.py index 310da89..5e393d2 100644 --- a/tests/test_markdown.py +++ b/tests/test_markdown.py @@ -1,14 +1,11 @@ """Test markdown module.""" from datetime import datetime -import os from typing import Any import markdown import pytest -import blag -from blag.blag import build from blag.markdown import convert_markdown, markdown_factory @@ -114,28 +111,3 @@ this --- is -- a test ... assert "mdash" not in html assert "ndash" not in html assert "hellip" not in html - - -def test_performance(args) -> None: - # create 1000 random markdown files in the content directory - with open(os.path.join(blag.__path__[0], "content", "testpage.md")) as fh: - markdown = fh.read() - for i in range(1000): - with open(f"content/{i}.md", "w") as f: - f.write(markdown) - - from time import time - - t = time() - build(args) - print(time() - t) - - import cProfile - - t = time() - cProfile.run("build(args)") - #build(args) - print(time() - t) - - - 1 / 0