Ejemplo n.º 1
0
    def test_namespace_values(self):
        optionset = _option_set.OptionSet()
        optionset.add_groups(_option_set.OptionGroup("group_a"))
        optionset.add_options(
            _option_set.Option("option_a",
                               group=optionset.groups["group_a"],
                               default="meep"))

        namespace = optionset.namespace(option_a="moop")

        assert namespace.option_a == "moop"
Ejemplo n.º 2
0
    def test_namespace(self):
        optionset = _option_set.OptionSet()
        optionset.add_groups(_option_set.OptionGroup("group_a"))
        optionset.add_options(
            _option_set.Option("option_a",
                               group=optionset.groups["group_a"],
                               default="meep"))

        namespace = optionset.namespace()

        assert hasattr(namespace, "option_a")
        assert not hasattr(namespace, "non_existant_option")
        assert namespace.option_a == "meep"
Ejemplo n.º 3
0
import functools
import os
import sys
from typing import Any, List, Optional, Sequence, Union

from nox import _option_set
from nox.tasks import discover_manifest, filter_manifest, load_nox_module
"""All of nox's configuration options."""

options = _option_set.OptionSet(
    description="Nox is a Python automation toolkit.", add_help=False)

options.add_groups(
    _option_set.OptionGroup(
        "primary",
        "Primary arguments",
        "These are the most common arguments used when invoking Nox.",
    ),
    _option_set.OptionGroup(
        "secondary",
        "Additional arguments & flags",
        "These arguments are used to control Nox's behavior or control advanced features.",
    ),
)


def _session_filters_merge_func(key: str, command_args: argparse.Namespace,
                                noxfile_args: argparse.Namespace) -> List[str]:
    """Only return the Noxfile value for sessions/pythons/keywords if neither sessions,
    pythons or keywords are specified on the command-line.
Ejemplo n.º 4
0
import functools
import os
import sys
from typing import Any, Sequence

from nox import _option_set
from nox.tasks import discover_manifest, filter_manifest, load_nox_module
"""All of Nox's configuration options."""

options = _option_set.OptionSet(
    description="Nox is a Python automation toolkit.", add_help=False)

options.add_groups(
    _option_set.OptionGroup(
        "general",
        "General options",
        "These are general arguments used when invoking Nox.",
    ),
    _option_set.OptionGroup(
        "sessions",
        "Sessions options",
        "These arguments are used to control which Nox session(s) to execute.",
    ),
    _option_set.OptionGroup(
        "python",
        "Python options",
        "These arguments are used to control which Python version(s) to use.",
    ),
    _option_set.OptionGroup(
        "environment",
        "Environment options",