Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytest follow-up #3674

Merged
merged 6 commits into from
Dec 16, 2019
Merged

Conversation

ltalirz
Copy link
Member

@ltalirz ltalirz commented Dec 15, 2019

starts to address #3659

  • Updates docs for pytest.
  • Brings pytest warnings from 423 down to 31:
    • fix usage of deprecated unittest api
    • fix tests skipped because of __init__ constructor
    • fix classes incorrectly identified as tests
    • fix deprecated usage of external modules
    • fix incorrect escape sequences in regular expressions
    • ignore unnecessary warnings from external packages
      Note: this could be made more flexible (e.g. narrowing down filters), since such warnings can sometimes be useful, e.g. if we are using a deprecated API of the package (say, django). Most of the time, it is the external package that is using some deprecated API.
  • adds individual test timings

Note: These are the slowest tests, all of which would be good to speed up

  Run test suite15m 15s
0.48s call     aiida/backends/tests/engine/test_process_function.py::TestProcessFunction::test_function_default_label
-- Docs: https://docs.pytest.org/en/latest/warnings.html
============================ slowest test durations ============================
22.95s call     aiida/backends/tests/tools/importexport/orm/test_links.py::TestLinks::test_high_level_workflow_links
10.74s call     aiida/backends/tests/tools/importexport/orm/test_links.py::TestLinks::test_complex_workflow_graph_export_sets
8.51s call     aiida/backends/tests/tools/importexport/orm/test_links.py::TestLinks::test_link_flags
8.01s call     aiida/backends/tests/test_nodes.py::TestNodeDeletion::test_delete_cases
5.95s call     aiida/backends/djsite/db/subtests/migrations/test_migrations_many.py::TestDuplicateNodeUuidMigration::test_deduplicated_uuids
5.60s call     aiida/backends/djsite/db/subtests/migrations/test_migrations_many.py::TestUuidMigration::test_uuid_untouched
5.52s call     aiida/backends/tests/engine/test_rmq.py::TestProcessControl::test_launch_with_inputs
5.44s call     aiida/backends/tests/engine/test_rmq.py::TestProcessControl::test_exception_process
5.38s call     aiida/backends/tests/engine/test_rmq.py::TestProcessControl::test_submit_simple
5.37s call     aiida/backends/tests/engine/test_futures.py::TestWf::test_calculation_future_broadcasts
4.31s call     aiida/backends/djsite/db/subtests/migrations/test_migrations_many.py::TestCalcAttributeKeysMigration::test_attribute_key_changes
4.22s call     aiida/backends/djsite/db/subtests/migrations/test_migrations_many.py::TestDbLogMigrationBackward::test_objpk_objname
4.19s call     aiida/cmdline/utils/test_multiline.py::TestMultilineInput::test_edit_comment
4.08s call     aiida/backends/djsite/db/subtests/migrations/test_migrations_many.py::TestGroupRenamingMigration::test_group_string_update
4.05s call     aiida/backends/djsite/db/subtests/migrations/test_migrations_many.py::TestDbLogMigrationRecordCleaning::test_dblog_unique_uuids
4.04s call     aiida/backends/djsite/db/subtests/migrations/test_migrations_many.py::TestDbLogMigrationRecordCleaning::test_dblog_calculation_node
4.03s call     aiida/backends/djsite/db/subtests/migrations/test_migrations_many.py::TestDbLogMigrationRecordCleaning::test_dblog_correct_export_of_logs
4.01s call     aiida/backends/djsite/db/subtests/migrations/test_migration

Copy link
Member

@greschd greschd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know if there's a command-line switch for re-enabling the deprecation warnings? Might be good to check these periodically.

@sphuber
Copy link
Contributor

sphuber commented Dec 16, 2019

Aha, I just did the same last night and fixed most of the warnings with 27 warnings. OK to merge this though, I will add the additional corrections in another PR. I also opened #3672 with the list of the three remaining problems. I tried fixing them but it was not trivial, so preferred not to do it in a big one. I also uncovered #3673 this way which is pretty serious. The caching is broken. At least the configuration and methods to control what is cached, that is

@sphuber
Copy link
Contributor

sphuber commented Dec 16, 2019

Do you know if there's a command-line switch for re-enabling the deprecation warnings? Might be good to check these periodically.

@greschd Note that sometimes it will be expected that there are warnings, for example coming from our own deprecation warnings. We still want to test those paths so we would not want to have those warnings fail the tests

@greschd
Copy link
Member

greschd commented Dec 16, 2019

Yeah, I meant "run and manually inspect" with warnings enabled, certainly shouldn't fail for that. Could be on the list of tools the dependency manager can use to detect future compatibily issues.
I guess one could just edit the ini file for that, though.

@ltalirz ltalirz merged commit a73e4b6 into aiidateam:develop Dec 16, 2019
@ltalirz
Copy link
Member Author

ltalirz commented Dec 16, 2019

Aha, I just did the same last night and fixed most of the warnings with 27 warnings. OK to merge this though, I will add the additional corrections in another PR.

Ah - damn! Anyhow, merged now.

@sphuber sphuber deleted the issue_3659_pytest_follow_up branch December 16, 2019 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants