code: install_deps> python -I -m pip install coverage pytest pytest-cov .pkg: install_requires> python -I -m pip install 'setuptools>=40.8.0' wheel .pkg: _optional_hooks> python /tmp/venv-mfqc/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__ .pkg: get_requires_for_build_sdist> python /tmp/venv-mfqc/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__ .pkg: get_requires_for_build_wheel> python /tmp/venv-mfqc/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__ .pkg: freeze> python -m pip freeze --all .pkg: pip==24.2,setuptools==74.1.2,wheel==0.44.0 .pkg: prepare_metadata_for_build_wheel> python /tmp/venv-mfqc/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__ .pkg: build_sdist> python /tmp/venv-mfqc/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__ code: install_package_deps> python -I -m pip install 'Scikit-learn>=0.18' influxdb 'joblib>=0.3.2' 'mdclogpy<=1.1.1' 'pandas>=1.1.3' ricxappframe==3.2.2 'schedule>=0.0.0' code: install_package> python -I -m pip install --force-reinstall --no-deps /w/workspace/ric-app-ad-tox-sonarqube/.tox/.tmp/package/1/ad-1.0.1.tar.gz code: freeze> python -m pip freeze --all code: ad==1.0.1,async-timeout==4.0.3,certifi==2024.8.30,charset-normalizer==3.3.2,coverage==7.6.1,exceptiongroup==1.2.2,hiredis==2.0.0,idna==3.8,influxdb==5.3.2,iniconfig==2.0.0,inotify==0.2.10,inotify_simple==1.3.5,joblib==1.4.2,mdclogpy==1.1.1,msgpack==1.1.0,nose==1.3.7,numpy==2.1.1,packaging==24.1,pandas==2.2.2,pip==24.2,pluggy==1.5.0,protobuf==3.20.3,pytest==8.3.3,pytest-cov==5.0.0,python-dateutil==2.9.0.post0,pytz==2024.2,redis==4.3.6,requests==2.32.3,ricsdl==3.1.3,ricxappframe==3.2.2,schedule==1.2.2,scikit-learn==1.5.2,scipy==1.14.1,setuptools==74.1.2,six==1.16.0,threadpoolctl==3.5.0,tomli==2.0.1,tzdata==2024.1,urllib3==2.2.3,wheel==0.44.0 code: commands[0]> pytest -v --cov src --cov-report xml --cov-report term-missing --cov-report html --cov-fail-under=50 ============================= test session starts ============================== platform linux -- Python 3.10.6, pytest-8.3.3, pluggy-1.5.0 -- /w/workspace/ric-app-ad-tox-sonarqube/.tox/code/bin/python cachedir: .tox/code/.pytest_cache rootdir: /w/workspace/ric-app-ad-tox-sonarqube plugins: cov-5.0.0 collecting ... collected 4 items tests/test_ad.py::test_database_connection PASSED [ 25%] tests/test_ad.py::test_trainModel PASSED [ 50%] tests/test_ad.py::test_predict_anomaly PASSED [ 75%] tests/test_ad.py::test_msg_to_ts PASSED [100%] =============================== warnings summary =============================== tests/test_ad.py::test_trainModel tests/test_ad.py::test_trainModel /w/workspace/ric-app-ad-tox-sonarqube/src/processing.py:52: FutureWarning: ChainedAssignmentError: behaviour will change in pandas 3.0! You are setting values through chained assignment. Currently this works in certain cases, but when using Copy-on-Write (which will become the default behaviour in pandas 3.0) this will never work to update the original DataFrame or Series, because the intermediate object on which we are setting values will behave as a copy. A typical example is when you are setting values in a column of a DataFrame, like: df["col"][row_indexer] = value Use `df.loc[row_indexer, "col"] = values` instead, to perform the assignment in a single step and ensure this keeps updating the original `df`. See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy self.data.iloc[:]['DRB.UEThpDl'] = self.data['DRB.UEThpDl'].apply(lambda x: x*1024) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ---------- coverage: platform linux, python 3.10.6-final-0 ----------- Name Stmts Miss Cover Missing ------------------------------------------------- src/__init__.py 0 0 100% src/ad_model.py 67 14 79% 42-43, 50-51, 57-58, 108-112, 121, 123, 125, 129 src/ad_train.py 69 6 91% 56-58, 66-68 src/database.py 94 34 64% 64-75, 85-97, 106-110, 113-118 src/exceptions.py 4 4 0% 18-25 src/insert.py 50 50 0% 21-84 src/main.py 116 65 44% 41-46, 70-83, 106-110, 119-130, 139, 146-163, 167-170, 174-177, 181-185, 190-192 src/processing.py 44 0 100% ------------------------------------------------- TOTAL 444 173 61% Coverage HTML written to dir htmlcov Coverage XML written to file coverage.xml Required test coverage of 50% reached. Total coverage: 61.04% ================== 4 passed, 2 warnings in 108.58s (0:01:48) =================== code: commands[1]> coverage xml -i Wrote XML report to coverage.xml code: OK ✔ in 2 minutes 26.55 seconds flake8: install_deps> python -I -m pip install flake8 flake8: freeze> python -m pip freeze --all flake8: ad==1.0.1,flake8==7.1.1,mccabe==0.7.0,pip==24.2,pycodestyle==2.12.1,pyflakes==3.2.0,setuptools==74.1.2,wheel==0.44.0 flake8: commands[0]> flake8 setup.py src tests code: OK (146.55=setup[36.22]+cmd[109.98,0.35] seconds) flake8: OK (3.93=setup[3.65]+cmd[0.29] seconds) congratulations :) (150.65 seconds)