Skip to content

tests_test_featurizer.py

Iuri Severo edited this page Apr 16, 2021 · 1 revision

Test Featurizer

Como o arquivo test_featurizer.py é um arquivo de teste, a métrica utilizada para comparação antes e depois da refatoração será o resultado da sua execução ao invés do resultado dos testes executados sobre ele.

Pré-refatoração

Comando: pytest tests/nlu/featurizers/test_featurizer.py

Resultado:

================================================= test session starts ==================================================
platform linux -- Python 3.7.6, pytest-6.2.3, py-1.10.0, pluggy-0.13.1
rootdir: /mnt/c/Users/NB/Desktop/faculdade/semestre_7/GCES/rasa, configfile: pytest.ini
plugins: asyncio-0.14.0, cov-2.11.1, forked-1.3.0, sanic-1.6.2, timeout-1.4.2, xdist-1.34.0, typeguard-2.12.0
timeout: 60.0s
timeout method: signal
timeout func_only: True
collected 4 items

tests/nlu/featurizers/test_featurizer.py ....                                                                    [100%]

=================================================== warnings summary ===================================================
.venv/lib/python3.7/site-packages/tensorflow/python/autograph/utils/testing.py:21
  /mnt/c/Users/NB/Desktop/faculdade/semestre_7/GCES/rasa/.venv/lib/python3.7/site-packages/tensorflow/python/autograph/utils/testing.py:21: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
    import imp

../../../../../../../../../home/iurisevero/.pyenv/versions/3.7.6/lib/python3.7/importlib/_bootstrap.py:219
  /home/iurisevero/.pyenv/versions/3.7.6/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
    return f(*args, **kwds)

tests/nlu/featurizers/test_featurizer.py::test_flexible_nlu_pipeline
  /mnt/c/Users/NB/Desktop/faculdade/semestre_7/GCES/rasa/rasa/shared/utils/io.py:97: UserWarning: Please configure the number of 'epochs' in your configuration file. We will change the default value of 'epochs' in the future to 1.
    warnings.warn(message, category=category, **kwargs)

tests/nlu/featurizers/test_featurizer.py::test_flexible_nlu_pipeline
  /mnt/c/Users/NB/Desktop/faculdade/semestre_7/GCES/rasa/rasa/utils/train_utils.py:565: UserWarning: constrain_similarities is set to `False`. It is recommended to set it to `True` when using cross-entropy loss. It will be set to `True` by default, Rasa Open Source 3.0.0 onwards.
    category=UserWarning,

tests/nlu/featurizers/test_featurizer.py::test_flexible_nlu_pipeline
  /mnt/c/Users/NB/Desktop/faculdade/semestre_7/GCES/rasa/rasa/utils/train_utils.py:537: UserWarning: model_confidence is set to `softmax`. It is recommended to try using `model_confidence=linear_norm` to make it easier to tune fallback thresholds.
    category=UserWarning,

-- Docs: https://docs.pytest.org/en/stable/warnings.html
============================================ 4 passed, 5 warnings in 5.20s =============================================

Pós-refatoração

Comando: pytest tests/nlu/featurizers/test_featurizer.py

Resultado:

================================================= test session starts ==================================================
platform linux -- Python 3.7.6, pytest-6.2.3, py-1.10.0, pluggy-0.13.1
rootdir: /mnt/c/Users/NB/Desktop/faculdade/semestre_7/GCES/rasa, configfile: pytest.ini
plugins: asyncio-0.14.0, cov-2.11.1, forked-1.3.0, sanic-1.6.2, timeout-1.4.2, xdist-1.34.0, typeguard-2.12.0
timeout: 60.0s
timeout method: signal
timeout func_only: True
collected 4 items

tests/nlu/featurizers/test_featurizer.py ....                                                                    [100%]

=================================================== warnings summary ===================================================
.venv/lib/python3.7/site-packages/tensorflow/python/autograph/utils/testing.py:21
  /mnt/c/Users/NB/Desktop/faculdade/semestre_7/GCES/rasa/.venv/lib/python3.7/site-packages/tensorflow/python/autograph/utils/testing.py:21: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
    import imp

../../../../../../../../../home/iurisevero/.pyenv/versions/3.7.6/lib/python3.7/importlib/_bootstrap.py:219
  /home/iurisevero/.pyenv/versions/3.7.6/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
    return f(*args, **kwds)

tests/nlu/featurizers/test_featurizer.py::test_flexible_nlu_pipeline
  /mnt/c/Users/NB/Desktop/faculdade/semestre_7/GCES/rasa/rasa/shared/utils/io.py:97: UserWarning: Please configure the number of 'epochs' in your configuration file. We will change the default value of 'epochs' in the future to 1.
    warnings.warn(message, category=category, **kwargs)

tests/nlu/featurizers/test_featurizer.py::test_flexible_nlu_pipeline
  /mnt/c/Users/NB/Desktop/faculdade/semestre_7/GCES/rasa/rasa/utils/train_utils.py:565: UserWarning: constrain_similarities is set to `False`. It is recommended to set it to `True` when using cross-entropy loss. It will be set to `True` by default, Rasa Open Source 3.0.0 onwards.
    category=UserWarning,

tests/nlu/featurizers/test_featurizer.py::test_flexible_nlu_pipeline
  /mnt/c/Users/NB/Desktop/faculdade/semestre_7/GCES/rasa/rasa/utils/train_utils.py:537: UserWarning: model_confidence is set to `softmax`. It is recommended to try using `model_confidence=linear_norm` to make it easier to tune fallback thresholds.
    category=UserWarning,

-- Docs: https://docs.pytest.org/en/stable/warnings.html
============================================ 4 passed, 5 warnings in 1.82s =============================================

Como pode ser observado, os testes não sofreram alterações na quantidade de items coletados, testes aprovados e warnings levantados.

Clone this wiki locally