forked from github.com/blag
WIP
This commit is contained in:
4
Makefile
4
Makefile
@@ -65,6 +65,10 @@ serve-docs: $(VENV)
|
|||||||
manpage: $(VENV)
|
manpage: $(VENV)
|
||||||
help2man $(BIN)/blag --no-info -n "blog-aware, static site generator" -o debian/blag.1
|
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
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
rm -rf build dist *.egg-info
|
rm -rf build dist *.egg-info
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
"""Test markdown module."""
|
"""Test markdown module."""
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import os
|
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
import markdown
|
import markdown
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
import blag
|
|
||||||
from blag.blag import build
|
|
||||||
from blag.markdown import convert_markdown, markdown_factory
|
from blag.markdown import convert_markdown, markdown_factory
|
||||||
|
|
||||||
|
|
||||||
@@ -114,28 +111,3 @@ this --- is -- a test ...
|
|||||||
assert "mdash" not in html
|
assert "mdash" not in html
|
||||||
assert "ndash" not in html
|
assert "ndash" not in html
|
||||||
assert "hellip" 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
|
|
||||||
|
|||||||
Reference in New Issue
Block a user