Skip to content

Commit

Permalink
chore: run pre-commit
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Dygalo <dmitry@dygalo.dev>
  • Loading branch information
Stranger6667 committed Mar 3, 2024
1 parent 68cacce commit eea3970
Show file tree
Hide file tree
Showing 26 changed files with 31 additions and 7 deletions.
1 change: 1 addition & 0 deletions changelog.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Simple CLI for changelog management."""

from __future__ import annotations
import argparse
import datetime
Expand Down
1 change: 1 addition & 0 deletions src/schemathesis/_dependency_versions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Compatibility flags based on installed dependency versions."""

from packaging import version

from importlib import metadata
Expand Down
1 change: 1 addition & 0 deletions src/schemathesis/_hypothesis.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""High-level API for creating Hypothesis tests."""

from __future__ import annotations

import asyncio
Expand Down
1 change: 1 addition & 0 deletions src/schemathesis/_xml.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""XML serialization."""

from __future__ import annotations
from io import StringIO
from typing import Any, Dict, List, Union
Expand Down
1 change: 1 addition & 0 deletions src/schemathesis/auths.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Support for custom API authentication mechanisms."""

from __future__ import annotations
import inspect
import threading
Expand Down
8 changes: 4 additions & 4 deletions src/schemathesis/cli/cassettes.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ def write_double_quoted(stream: IO, text: str) -> None:
ch = text[end]
if (
ch is None
or ch in '"\\\x85\u2028\u2029\uFEFF'
or not ("\x20" <= ch <= "\x7E" or ("\xA0" <= ch <= "\uD7FF" or "\uE000" <= ch <= "\uFFFD"))
or ch in '"\\\x85\u2028\u2029\ufeff'
or not ("\x20" <= ch <= "\x7e" or ("\xa0" <= ch <= "\ud7ff" or "\ue000" <= ch <= "\ufffd"))
):
if start < end:
stream.write(text[start:end])
Expand All @@ -264,9 +264,9 @@ def write_double_quoted(stream: IO, text: str) -> None:
# Escape character
if ch in Emitter.ESCAPE_REPLACEMENTS:
data = "\\" + Emitter.ESCAPE_REPLACEMENTS[ch]
elif ch <= "\xFF":
elif ch <= "\xff":
data = "\\x%02X" % ord(ch)
elif ch <= "\uFFFF":
elif ch <= "\uffff":
data = "\\u%04X" % ord(ch)
else:
data = "\\U%08X" % ord(ch)
Expand Down
1 change: 1 addition & 0 deletions src/schemathesis/filters.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Filtering system that allows users to filter API operations based on certain criteria."""

from __future__ import annotations
import re
from dataclasses import dataclass, field
Expand Down
1 change: 1 addition & 0 deletions src/schemathesis/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
These are basic entities that describe what data could be sent to the API.
"""

from __future__ import annotations
from dataclasses import dataclass, field
from typing import TYPE_CHECKING, Any, Generator, Generic, TypeVar
Expand Down
1 change: 1 addition & 0 deletions src/schemathesis/runner/probes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
For example, certail web servers do not support NULL bytes in headers, in such cases, the generated test case
will not reach the tested application at all.
"""

from __future__ import annotations

import enum
Expand Down
1 change: 1 addition & 0 deletions src/schemathesis/runner/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
They all consist of primitive types and don't have references to schemas, app, etc.
"""

from __future__ import annotations
import logging
import re
Expand Down
1 change: 1 addition & 0 deletions src/schemathesis/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
They give only static definitions of paths.
"""

from __future__ import annotations
from collections.abc import Mapping, MutableMapping
from contextlib import nullcontext
Expand Down
1 change: 1 addition & 0 deletions src/schemathesis/service/hosts.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Work with stored auth data."""

from __future__ import annotations
import enum
import tempfile
Expand Down
1 change: 1 addition & 0 deletions src/schemathesis/service/metadata.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Useful info to collect from CLI usage."""

from __future__ import annotations
import os
import platform
Expand Down
1 change: 1 addition & 0 deletions src/schemathesis/specs/openapi/expressions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
https://swagger.io/docs/specification/links/#runtime-expressions
"""

from typing import Any

from . import lexer, nodes, parser
Expand Down
1 change: 1 addition & 0 deletions src/schemathesis/specs/openapi/expressions/lexer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Lexical analysis of runtime expressions."""

from dataclasses import dataclass
from enum import Enum, unique
from typing import Callable, Generator
Expand Down
1 change: 1 addition & 0 deletions src/schemathesis/specs/openapi/expressions/nodes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Expression nodes description and evaluation logic."""

from __future__ import annotations
from dataclasses import dataclass
from enum import Enum, unique
Expand Down
1 change: 1 addition & 0 deletions src/schemathesis/specs/openapi/links.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Based on https://swagger.io/docs/specification/links/
"""

from __future__ import annotations
from dataclasses import dataclass, field
from difflib import get_close_matches
Expand Down
1 change: 1 addition & 0 deletions src/schemathesis/specs/openapi/negative/mutations.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Schema mutations."""

from __future__ import annotations
import enum
from dataclasses import dataclass
Expand Down
1 change: 1 addition & 0 deletions src/schemathesis/specs/openapi/security.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Processing of ``securityDefinitions`` or ``securitySchemes`` keywords."""

from __future__ import annotations
from dataclasses import dataclass
from typing import Any, ClassVar, Generator
Expand Down
6 changes: 3 additions & 3 deletions test/cli/test_cassettes.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,9 @@ def test_forbid_preserve_exact_bytes_without_cassette_path(cli, schema_url, snap

@given(text=st.text())
@example("Test")
@example("\uFEFF")
@example("\uE001")
@example("\xA1")
@example("\ufeff")
@example("\ue001")
@example("\xa1")
@example("\x21")
@example("\x07")
@example("🎉")
Expand Down
1 change: 1 addition & 0 deletions test/loaders/test_common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for common schema loading logic shared by all loaders."""

import json
import platform
from contextlib import suppress
Expand Down
1 change: 1 addition & 0 deletions test/loaders/test_graphql.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""GraphQL specific loader behavior."""

from io import StringIO
import json

Expand Down
1 change: 1 addition & 0 deletions test/loaders/test_openapi.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI specific loader behavior."""

import json
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions test/specs/openapi/parameters/test_forms.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for parsing of parameters related to forms."""

import pytest

from schemathesis.parameters import PayloadAlternatives
Expand Down
1 change: 1 addition & 0 deletions test/specs/openapi/parameters/test_non_payload.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for parsing of non-payload parameters."""

from schemathesis.parameters import ParameterSet
from schemathesis.specs.openapi.parameters import OpenAPI20Parameter, OpenAPI30Parameter

Expand Down
1 change: 1 addition & 0 deletions test/specs/openapi/parameters/test_simple_payloads.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for behavior not specific to forms."""

import pytest

import schemathesis
Expand Down

0 comments on commit eea3970

Please sign in to comment.