pytest-django icon indicating copy to clipboard operation
pytest-django copied to clipboard

Test suite fails using pytest-django 4.4 and pytest 6.2.4

Open apteryks opened this issue 4 years ago • 1 comments
trafficstars

The package on GNU Guix previously built successfully using:

dependencies: [email protected] [email protected] [email protected]
+ [email protected]

But after updating just pytest to 6.2.4, there are already these failures:

=========================== short test summary info ============================
SKIPPED [1] tests/test_django_configurations.py:7: could not import 'configurations': No module named 'configurations'
SKIPPED [1] tests/test_db_setup.py:456: Django 1.9 requires migration and has no concept of initial data fixtures
FAILED tests/test_db_access_in_repr.py::test_db_access_with_repr_in_report - ...
FAILED tests/test_db_setup.py::TestNativeMigrations::test_no_migrations - Fai...
FAILED tests/test_fixtures.py::test_custom_user_model[email] - Failed: nomatc...
FAILED tests/test_fixtures.py::test_custom_user_model[identifier] - Failed: n...
FAILED tests/test_initialization.py::test_django_setup_order_and_uniqueness
FAILED tests/test_unittest.py::test_sole_test - Failed: nomatch: '*::test_foo...
FAILED tests/test_unittest.py::TestUnittestMethods::test_setUpClass_leaf_but_not_in_dunder_dict
FAILED tests/test_unittest.py::test_debug_not_used - Failed: nomatch: '*= 1 p...
= 8 failed, 159 passed, 2 skipped, 7 deselected, 5 warnings in 62.06s (0:01:02) =

See: python-pytest-django-3.10.0-with-pytest-6.2.4.drv.txt

Updating pytest-xdist to latest 2.3.0 produces the same results as above.

So let's next update pytest-django itself to 4.4; it worsens to:

=========================== short test summary info ============================
SKIPPED [1] tests/test_django_configurations.py:7: could not import 'configurations': No module named 'configurations'
FAILED tests/test_database.py::TestDatabaseFixtures::test_django_db_reset_sequences_fixture
FAILED tests/test_fixtures.py::test_django_assert_num_queries_output_info - F...
FAILED tests/test_database.py::test_unittest_interaction - Failed: nomatch: '...
FAILED tests/test_database.py::Test_database_blocking::test_db_access_in_conftest
FAILED tests/test_database.py::Test_database_blocking::test_db_access_in_test_module
FAILED tests/test_db_access_in_repr.py::test_db_access_with_repr_in_report - ...
FAILED tests/test_db_setup.py::test_db_reuse_simple - assert <ExitCode.TESTS_...
FAILED tests/test_db_setup.py::test_db_order - assert <ExitCode.TESTS_FAILED:...
FAILED tests/test_db_setup.py::test_db_reuse - assert <ExitCode.TESTS_FAILED:...
FAILED tests/test_db_setup.py::TestSqlite::test_sqlite_test_name_used - asser...
FAILED tests/test_db_setup.py::test_xdist_with_reuse - assert <ExitCode.TESTS...
FAILED tests/test_db_setup.py::TestSqliteWithXdist::test_sqlite_in_memory_used
FAILED tests/test_db_setup.py::TestSqliteWithMultipleDbsAndXdist::test_sqlite_database_renamed
FAILED tests/test_db_setup.py::TestSqliteWithTox::test_db_with_tox_suffix - a...
FAILED tests/test_db_setup.py::TestSqliteWithTox::test_db_with_empty_tox_suffix
FAILED tests/test_db_setup.py::TestSqliteWithToxAndXdist::test_db_with_tox_suffix
FAILED tests/test_db_setup.py::TestSqliteInMemoryWithXdist::test_sqlite_in_memory_used
FAILED tests/test_db_setup.py::TestNativeMigrations::test_no_migrations - ass...
FAILED tests/test_db_setup.py::TestNativeMigrations::test_migrations_run - as...
FAILED tests/test_environment.py::TestrunnerVerbosity::test_default - Failed:...
FAILED tests/test_environment.py::TestrunnerVerbosity::test_vq_verbosity_0 - ...
FAILED tests/test_environment.py::TestrunnerVerbosity::test_verbose_with_v - ...
FAILED tests/test_environment.py::TestrunnerVerbosity::test_more_verbose_with_vv
FAILED tests/test_environment.py::TestrunnerVerbosity::test_more_verbose_with_vv_and_reusedb
FAILED tests/test_fixtures.py::test_django_assert_num_queries_output - Failed...
FAILED tests/test_fixtures.py::test_django_assert_num_queries_output_verbose
FAILED tests/test_fixtures.py::TestLiveServer::test_serve_static_with_staticfiles_app
FAILED tests/test_fixtures.py::test_custom_user_model[email] - Failed: nomatc...
FAILED tests/test_fixtures.py::test_custom_user_model[identifier] - Failed: n...
FAILED tests/test_unittest.py::test_sole_test - Failed: nomatch: '*::test_foo...
FAILED tests/test_unittest.py::TestUnittestMethods::test_django - Failed: nom...
FAILED tests/test_unittest.py::TestUnittestMethods::test_setUpClass_not_being_a_classmethod
FAILED tests/test_unittest.py::TestUnittestMethods::test_setUpClass_multiple_subclasses
FAILED tests/test_unittest.py::TestUnittestMethods::test_setUpClass_mixin - F...
FAILED tests/test_unittest.py::TestUnittestMethods::test_setUpClass_skip - Fa...
FAILED tests/test_unittest.py::TestUnittestMethods::test_multi_inheritance_setUpClass
FAILED tests/test_unittest.py::TestUnittestMethods::test_setUpClass_leaf_but_not_in_dunder_dict
FAILED tests/test_unittest.py::test_pdb_enabled - assert <ExitCode.INTERRUPTE...
FAILED tests/test_unittest.py::test_debug_not_used - Failed: nomatch: '*= 1 p...
===== 39 failed, 146 passed, 1 skipped, 7 deselected, 1 warning in 49.07s ======

See: python-pytest-django-4.4.0.drv.txt

Updating Django itself to latest, at 3.2.6 doesn't change the above result.

So we're now with these dependencies:

dependencies: [email protected] [email protected] [email protected]
+ [email protected]

The complete transitive dependencies in use are:

[email protected] depends on the following 211 packages: [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] kmod@27 [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] argon2@20190702 [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] tzdata@2019c [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] ld-wrapper@0 [email protected] [email protected] [email protected] [email protected]

Any ideas how to make the test suite work?

Thank you!

apteryks avatar Aug 28 '21 19:08 apteryks

The main problem seems to be ModuleNotFoundError: No module named 'pytest_django_test'. It looks like a kind of issue caused by:

  • The tests running out of the tree, making relative paths incorrect
  • Missing data in the distribution

If you can figure out why imports of pytest_django_test are failing, I think it will fix the build. If there's anything pytest-django can improve/robustify in this regard, we'll be happy to.

bluetech avatar Nov 30 '21 10:11 bluetech