Skip to content

Commit

Permalink
chore: Remove commented code, add docstrings, remove redundant except…
Browse files Browse the repository at this point in the history
…ion class
  • Loading branch information
Stranger6667 committed May 3, 2020
1 parent cdc3873 commit d668022
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/schemathesis/cli/options.py
Expand Up @@ -36,5 +36,5 @@ def convert( # type: ignore
try:
int(value)
return super().convert(value, param, ctx)
except (ValueError, UnicodeError):
except ValueError:
self.fail("%s is not a valid integer or None" % value, param, ctx)
16 changes: 8 additions & 8 deletions src/schemathesis/hooks.py
Expand Up @@ -184,42 +184,42 @@ def unregister_all(self) -> None:

@all_scopes
def before_generate_path_parameters(strategy: st.SearchStrategy, context: HookContext) -> st.SearchStrategy:
pass
"""Called on a strategy that generates values for ``path_parameters``."""


@all_scopes
def before_generate_headers(strategy: st.SearchStrategy, context: HookContext) -> st.SearchStrategy:
pass
"""Called on a strategy that generates values for ``headers``."""


@all_scopes
def before_generate_cookies(strategy: st.SearchStrategy, context: HookContext) -> st.SearchStrategy:
pass
"""Called on a strategy that generates values for ``cookies``."""


@all_scopes
def before_generate_query(strategy: st.SearchStrategy, context: HookContext) -> st.SearchStrategy:
pass
"""Called on a strategy that generates values for ``query``."""


@all_scopes
def before_generate_body(strategy: st.SearchStrategy, context: HookContext) -> st.SearchStrategy:
pass
"""Called on a strategy that generates values for ``body``."""


@all_scopes
def before_generate_form_data(strategy: st.SearchStrategy, context: HookContext) -> st.SearchStrategy:
pass
"""Called on a strategy that generates values for ``form_data``."""


@all_scopes
def before_process_path(context: HookContext, path: str, methods: Dict[str, Any]) -> None:
pass
"""Called before API path is processed."""


@HookDispatcher.register_spec([HookScope.GLOBAL])
def before_load_schema(context: HookContext, raw_schema: Dict[str, Any]) -> None:
pass
"""Called before schema instance is created."""


GLOBAL_HOOK_DISPATCHER = HookDispatcher(scope=HookScope.GLOBAL)
Expand Down
1 change: 0 additions & 1 deletion test/cli/test_commands.py
Expand Up @@ -806,7 +806,6 @@ def assert_threaded_executor_interruption(lines, expected, optional_interrupt=Fa
if not optional_interrupt:
assert "!! KeyboardInterrupt !!" in lines[11]
if "F" in lines[10]:
# assert "=== FAILURES ===" in lines[12]
if "!! KeyboardInterrupt !!" not in lines[11]:
assert "=== FAILURES ===" in lines[12]
position = 23
Expand Down

0 comments on commit d668022

Please sign in to comment.