def test_collect_imports_enabled(pytester: Pytester, configure_ini: bool) -> None:
    """
    When collect_imported_tests is enabled (the default), all names in the
    test modules are collected as tests.
    """
    if configure_ini:
        pytester.makeini(
            """
            [pytest]
            collect_imported_tests = true
            """
        )

    setup_files(pytester)
    result = pytester.runpytest("-v", "tests")
    result.stdout.fnmatch_lines(
        [
            "tests/foo_test.py::Testament::test_collections PASSED*",
            "tests/foo_test.py::test_testament PASSED*",
            "tests/foo_test.py::TestDomain::test PASSED*",
        ]
    )

    When collect_imported_tests is enabled (the default), all names in the
    test modules are collected as tests.
    
testing/test_collect_imported_tests.py