def test_enable_disable_conflict_with_config():
    """Test conflict between enable/disable w.r.t. `nlp.disabled` set in the config."""
    nlp = English()
    nlp.add_pipe("tagger")
    nlp.add_pipe("senter")
    nlp.add_pipe("sentencizer")

    with make_tempdir() as tmp_dir:
        nlp.to_disk(tmp_dir)
        # Expected to succeed, as config and arguments do not conflict.
        assert spacy.load(
            tmp_dir, enable=["tagger"], config={"nlp": {"disabled": ["senter"]}}
        ).disabled == ["senter", "sentencizer"]
        # Expected to succeed without warning due to the lack of a conflicting config option.
        spacy.load(tmp_dir, enable=["tagger"])
        # Expected to fail due to conflict between enable and disabled.
        with pytest.raises(ValueError):
            spacy.load(
                tmp_dir,
                enable=["senter"],
                config={"nlp": {"disabled": ["senter", "tagger"]}},
            )
Test conflict between enable/disable w.r.t. `nlp.disabled` set in the config.
spacy/tests/pipeline/test_pipe_methods.py