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-iAfC/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__ .pkg: get_requires_for_build_sdist> python /tmp/venv-iAfC/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__ .pkg: get_requires_for_build_wheel> python /tmp/venv-iAfC/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__ .pkg: freeze> python -m pip freeze --all .pkg: pip==24.1,setuptools==70.1.0,wheel==0.43.0 .pkg: prepare_metadata_for_build_wheel> python /tmp/venv-iAfC/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__ .pkg: build_sdist> python /tmp/venv-iAfC/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.6.2,charset-normalizer==3.3.2,coverage==7.5.4,exceptiongroup==1.2.1,hiredis==2.0.0,idna==3.7,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.0.8,nose==1.3.7,numpy==2.0.0,packaging==24.1,pandas==2.2.2,pip==24.1,pluggy==1.5.0,protobuf==3.20.3,pytest==8.2.2,pytest-cov==5.0.0,python-dateutil==2.9.0.post0,pytz==2024.1,redis==4.3.6,requests==2.32.3,ricsdl==3.1.3,ricxappframe==3.2.2,schedule==1.2.2,scikit-learn==1.5.0,scipy==1.14.0,setuptools==70.1.0,six==1.16.0,threadpoolctl==3.5.0,tomli==2.0.1,tzdata==2024.1,urllib3==2.2.2,wheel==0.43.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.2.2, 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.47s (0:01:48) =================== code: commands[1]> coverage xml -i Wrote XML report to coverage.xml code: OK ✔ in 2 minutes 26.16 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.0,mccabe==0.7.0,pip==24.1,pycodestyle==2.12.0,pyflakes==3.2.0,setuptools==70.1.0,wheel==0.43.0 flake8: commands[0]> flake8 setup.py src tests code: OK (146.15=setup[35.96]+cmd[109.95,0.24] seconds) flake8: OK (3.33=setup[3.07]+cmd[0.26] seconds) congratulations :) (149.64 seconds)