aiidateam / aiida-plugin-cutter

Cookie cutter recipe for AiiDA plugins.
9 stars 12 forks source link

Resolve aiida deprecation warning in the tests #111

Open agoscinski opened 4 months ago

agoscinski commented 4 months ago

Running pytest I get the following warnings (tests pass)

../../.local/share/hatch/env/virtual/aiida-diff/UgDmwqUy/hatch-test.py3.10/lib/python3.10/site-packages/aiida/manage/tests/pytest_fixtures.py:54
  /home/alexgo/.local/share/hatch/env/virtual/aiida-diff/UgDmwqUy/hatch-test.py3.10/lib/python3.10/site-packages/aiida/manage/tests/pytest_fixtures.py:54: AiidaDeprecationWarning: The module `aiida.manage.tests.pytest_fixtures` is deprecated, please use `aiida.tools.pytest_fixtures` instead. (this will be removed in v3)
    warn_deprecation(

tests/test_calculations.py::test_process
tests/test_cli.py::TestDataCli::test_data_diff_list
tests/test_cli.py::TestDataCli::test_data_diff_export
  /home/alexgo/.local/share/hatch/env/virtual/aiida-diff/UgDmwqUy/hatch-test.py3.10/lib/python3.10/site-packages/aiida/manage/tests/pytest_fixtures.py:384: AiidaDeprecationWarning: the clear_database_after_test fixture is deprecated, use aiida_profile_clean instead (this will be removed in v3)
    warn_deprecation('the clear_database_after_test fixture is deprecated, use aiida_profile_clean instead', version=3)

tests/test_calculations.py::test_process
tests/test_calculations.py::test_process
tests/test_calculations.py::test_process
tests/test_calculations.py::test_process
  /home/alexgo/.local/share/hatch/env/virtual/aiida-diff/UgDmwqUy/hatch-test.py3.10/lib/python3.10/site-packages/aiida/storage/psql_dos/orm/utils.py:84: SAWarning: Object of type <DbNode> not in session, add operation along 'DbUser.dbnodes' will not proceed (This warning originated from the Session 'autoflush' process, which was invoked automatically in response to a user-initiated operation.)
    return getattr(self._model, item)

tests/test_calculations.py::test_process
  /home/alexgo/.local/share/hatch/env/virtual/aiida-diff/UgDmwqUy/hatch-test.py3.10/lib/python3.10/site-packages/aiida/storage/psql_dos/orm/querybuilder/main.py:182: SAWarning: Object of type <DbNode> not in session, add operation along 'DbUser.dbnodes' will not proceed (This warning originated from the Session 'autoflush' process, which was invoked automatically in response to a user-initiated operation.)
    result = build.query.count()

tests/test_calculations.py::test_process
  /home/alexgo/.local/share/hatch/env/virtual/aiida-diff/UgDmwqUy/hatch-test.py3.10/lib/python3.10/site-packages/aiida/storage/psql_dos/orm/nodes.py:224: SAWarning: Object of type <DbNode> not in session, add operation along 'DbComputer.dbnodes' will not proceed
    session.commit()

tests/test_calculations.py::test_process
  /home/alexgo/.local/share/hatch/env/virtual/aiida-diff/UgDmwqUy/hatch-test.py3.10/lib/python3.10/site-packages/aiida/storage/psql_dos/orm/utils.py:84: SAWarning: Object of type <DbNode> not in session, add operation along 'DbComputer.dbnodes' will not proceed (This warning originated from the Session 'autoflush' process, which was invoked automatically in response to a user-initiated operation.)
    return getattr(self._model, item)