mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-16 06:37:04 +03:00
8e7deaf210
- test_issue7001-8000.py - test_issue8190.py
25 lines
705 B
Python
25 lines
705 B
Python
import pytest
|
|
|
|
import spacy
|
|
from spacy.lang.en import English
|
|
from ..util import make_tempdir
|
|
|
|
|
|
@pytest.mark.issue(8190)
|
|
def test_issue8190():
|
|
"""Test that config overrides are not lost after load is complete."""
|
|
source_cfg = {
|
|
"nlp": {
|
|
"lang": "en",
|
|
},
|
|
"custom": {"key": "value"},
|
|
}
|
|
source_nlp = English.from_config(source_cfg)
|
|
with make_tempdir() as dir_path:
|
|
# We need to create a loadable source pipeline
|
|
source_path = dir_path / "test_model"
|
|
source_nlp.to_disk(source_path)
|
|
nlp = spacy.load(source_path, config={"custom": {"key": "updated_value"}})
|
|
|
|
assert nlp.config["custom"]["key"] == "updated_value"
|