Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 23, 2025
1 parent f7268cb commit 876ec6e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/spelling_wordlist.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Bluesky
Bugfixes
CPython
Changelog
Codecov
CPython
Cython
GPG
IPv
Expand Down
40 changes: 30 additions & 10 deletions tests/test_quoting_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,79 +20,99 @@
LONG_QUERY_WITH_PCT = LONG_QUERY + "&d=%25%2F%3F%3A%40%26%3B%3D%2B"


@pytest.mark.skipif(BenchmarkFixture is None, reason="pytest-codspeed needs to be installed")
@pytest.mark.skipif(
BenchmarkFixture is None, reason="pytest-codspeed needs to be installed"
)
def test_quote_query_string(benchmark: BenchmarkFixture) -> None:
@benchmark
def _run() -> None:
for _ in range(100):
QUERY_QUOTER("a=1&b=2&c=3&d=4&e=5&f=6&g=7&h=8&i=9&j=0")


@pytest.mark.skipif(BenchmarkFixture is None, reason="pytest-codspeed needs to be installed")
@pytest.mark.skipif(
BenchmarkFixture is None, reason="pytest-codspeed needs to be installed"
)
def test_quoter_ascii(benchmark: BenchmarkFixture) -> None:
@benchmark
def _run() -> None:
for _ in range(100):
QUOTER_SLASH_SAFE("/path/to")


@pytest.mark.skipif(BenchmarkFixture is None, reason="pytest-codspeed needs to be installed")
@pytest.mark.skipif(
BenchmarkFixture is None, reason="pytest-codspeed needs to be installed"
)
def test_quote_long_path(benchmark: BenchmarkFixture) -> None:
@benchmark
def _run() -> None:
for _ in range(100):
PATH_QUOTER(LONG_PATH)


@pytest.mark.skipif(BenchmarkFixture is None, reason="pytest-codspeed needs to be installed")
@pytest.mark.skipif(
BenchmarkFixture is None, reason="pytest-codspeed needs to be installed"
)
def test_quoter_pct(benchmark: BenchmarkFixture) -> None:
@benchmark
def _run() -> None:
for _ in range(100):
QUOTER("abc%0a")


@pytest.mark.skipif(BenchmarkFixture is None, reason="pytest-codspeed needs to be installed")
@pytest.mark.skipif(
BenchmarkFixture is None, reason="pytest-codspeed needs to be installed"
)
def test_long_query(benchmark: BenchmarkFixture) -> None:
@benchmark
def _run() -> None:
for _ in range(100):
QUERY_QUOTER(LONG_QUERY)


@pytest.mark.skipif(BenchmarkFixture is None, reason="pytest-codspeed needs to be installed")
@pytest.mark.skipif(
BenchmarkFixture is None, reason="pytest-codspeed needs to be installed"
)
def test_long_query_with_pct(benchmark: BenchmarkFixture) -> None:
@benchmark
def _run() -> None:
for _ in range(100):
QUERY_QUOTER(LONG_QUERY_WITH_PCT)


@pytest.mark.skipif(BenchmarkFixture is None, reason="pytest-codspeed needs to be installed")
@pytest.mark.skipif(
BenchmarkFixture is None, reason="pytest-codspeed needs to be installed"
)
def test_quoter_quote_utf8(benchmark: BenchmarkFixture) -> None:
@benchmark
def _run() -> None:
for _ in range(100):
PATH_QUOTER("/шлях/файл")


@pytest.mark.skipif(BenchmarkFixture is None, reason="pytest-codspeed needs to be installed")
@pytest.mark.skipif(
BenchmarkFixture is None, reason="pytest-codspeed needs to be installed"
)
def test_unquoter_short(benchmark: BenchmarkFixture) -> None:
@benchmark
def _run() -> None:
for _ in range(100):
UNQUOTER("/path/to")


@pytest.mark.skipif(BenchmarkFixture is None, reason="pytest-codspeed needs to be installed")
@pytest.mark.skipif(
BenchmarkFixture is None, reason="pytest-codspeed needs to be installed"
)
def test_unquoter_long_ascii(benchmark: BenchmarkFixture) -> None:
@benchmark
def _run() -> None:
for _ in range(100):
UNQUOTER(LONG_QUERY)


@pytest.mark.skipif(BenchmarkFixture is None, reason="pytest-codspeed needs to be installed")
@pytest.mark.skipif(
BenchmarkFixture is None, reason="pytest-codspeed needs to be installed"
)
def test_unquoter_long_pct(benchmark: BenchmarkFixture) -> None:
@benchmark
def _run() -> None:
Expand Down

0 comments on commit 876ec6e

Please sign in to comment.