File: conftest.py

package info (click to toggle)
python-flake8 7.1.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,212 kB
  • sloc: python: 6,592; sh: 21; makefile: 19
file content (24 lines) | stat: -rw-r--r-- 669 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""Shared fixtures between unit tests."""
from __future__ import annotations

import argparse

import pytest


def options_from(**kwargs):
    """Generate a Values instances with our kwargs."""
    kwargs.setdefault("hang_closing", True)
    kwargs.setdefault("max_line_length", 79)
    kwargs.setdefault("max_doc_length", None)
    kwargs.setdefault("indent_size", 4)
    kwargs.setdefault("verbose", 0)
    kwargs.setdefault("stdin_display_name", "stdin")
    kwargs.setdefault("disable_noqa", False)
    return argparse.Namespace(**kwargs)


@pytest.fixture
def default_options():
    """Fixture returning the default options of flake8."""
    return options_from()