pip install pytest pytest-cov pytest-randomly pytest-mock
- pytest-cov: カバレッジ計測プラグイン
- pytest-randomly: 実行順のランダム化
- pytest-mock: mock利用プラグイン
| (leaf *preferences | |
| :config | |
| (setq custom-file "~/.emacs-custom.el") | |
| (setq visible-bell t) | |
| (load custom-file) | |
| (menu-bar-mode -1) | |
| (tool-bar-mode -1) | |
| (set-face-attribute 'default nil :family "Noto Sans Mono" :height 140) | |
| (load-theme 'tango-dark t)) |
| { | |
| "python.pythonPath": ".venv\\Scripts\\python.exe", | |
| "python.linting.flake8Enabled": true, | |
| "python.linting.mypyEnabled": true, | |
| "python.formatting.provider": "black", | |
| "editor.formatOnSave": true | |
| } |
| import dataclasses | |
| from .converters import Converter | |
| def _is_dataclasses_class(obj): | |
| return dataclasses.is_dataclass(obj) | |
| class DataclassesConverter(Converter): | |
| def __init__(self, *args, **kwargs): |
| from pyramid.config import Configurator | |
| def hello(request): | |
| return dict(message="Hello, world!") | |
| def main(global_conf, **settings): | |
| config = Configurator(settings=settings) | |
| config.include("pyramid_jinja2") |
| import json | |
| import inspect | |
| from datetime import datetime | |
| from dataclasses import dataclass, asdict | |
| from typing import TypeVar, Generic, Optional, Callable, Dict, Any, Type, Iterable, Sequence | |
| from typing_extensions import Protocol | |
| import webob | |
| import webtest | |
| import marshmallow_dataclass | |
| from marshmallow import Schema |
| { | |
| "python.pythonPath": ".venv\\Scripts\\python.exe", | |
| "python.jediEnabled": false, | |
| "python.formatting.provider": "black", | |
| "python.linting.flake8Enabled": true, | |
| "python.linting.mypyEnabled": true, | |
| "editor.formatOnSave": true | |
| } |
| from zope.publisher.paste import Application | |
| from zope.publisher.interfaces import IPublication | |
| from zope.interface import implementer | |
| from zope.component import getGlobalSiteManager | |
| @implementer(IPublication) | |
| class MyWorkPublication: | |
| def __init__(self, global_conf, **app_conf): | |
| pass |
| import argparse | |
| import dataclasses | |
| from typing import TypeVar, Generic, Type | |
| T = TypeVar("T") | |
| class Parser(Generic[T]): | |
| def __init__(self, cls: Type[T]) -> None: | |
| assert dataclasses.is_dataclass(cls) |
| from datetime import datetime | |
| from typing import Type, TypeVar, Generic | |
| from sqlalchemy import ( | |
| create_engine, | |
| MetaData, | |
| Integer, | |
| Unicode, | |
| DateTime, | |
| Column, | |
| Table, |