Exemplo n.º 1
0
 def test_session_completer_invalid_sessions(self):
     parsed_args = _options.options.namespace(sessions=("baz", ),
                                              keywords=(),
                                              posargs=[])
     all_nox_sessions = _options._session_completer(prefix=None,
                                                    parsed_args=parsed_args)
     assert len(all_nox_sessions) == 0
Exemplo n.º 2
0
 def test_session_completer(self):
     parsed_args = _options.options.namespace(sessions=(), keywords=())
     all_nox_sessions = _options._session_completer(prefix=None,
                                                    parsed_args=parsed_args)
     # if noxfile.py changes, this will have to change as well since these are
     # some of the actual sessions found in noxfile.py
     some_expected_sessions = ["cover", "blacken", "lint", "docs"]
     assert len(set(some_expected_sessions) - set(all_nox_sessions)) == 0
Exemplo n.º 3
0
    def test_session_completer(self):
        parsed_args = _options.options.namespace(
            posargs=[],
            noxfile=str(RESOURCES.joinpath("noxfile_multiple_sessions.py")),
        )
        actual_sessions_from_file = _options._session_completer(
            prefix=None, parsed_args=parsed_args)

        expected_sessions = ["testytest", "lintylint", "typeytype"]
        assert expected_sessions == actual_sessions_from_file
Exemplo n.º 4
0
 def test_session_completer(self):
     with mock.patch("sys.argv", [sys.executable]):
         parsed_args = _options.options.parse_args()
         all_nox_sessions = _options._session_completer(
             prefix=None, parsed_args=parsed_args)
         # if noxfile.py changes, this will have to change as well since these are
         # some of the actual sessions found in noxfile.py
         some_expected_sessions = ["cover", "blacken", "lint", "docs"]
         assert len(set(some_expected_sessions) -
                    set(all_nox_sessions)) == 0