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

unit test failing #283

Open
maribu opened this issue Jul 4, 2024 · 0 comments
Open

unit test failing #283

maribu opened this issue Jul 4, 2024 · 0 comments

Comments

@maribu
Copy link

maribu commented Jul 4, 2024

With the latest release (0.8.2) using Python 3.12.3 the following unit test fails:

_____________________________________________ TestDefaultOrderedDict.test_simple ______________________________________________

self = <simplesat.utils.tests.test_collections.TestDefaultOrderedDict testMethod=test_simple>

    def test_simple(self):
        # Given
        data = DefaultOrderedDict(list)
    
        # When
        data[1].append(1)
        data[0].append(0)
    
        # Then
        self.assertEqual(list(data.keys()), [1, 0])
        self.assertEqual(data[0], [0])
        self.assertEqual(data[1], [1])
        self.assertEqual(data[2], [])
        if sys.version_info[0] == 2:
            r_repr = ("DefaultOrderedDict(<type 'list'>, "
                      "DefaultOrderedDict([(1, [1]), (0, [0]), (2, [])]))")
        else:
            r_repr = ("DefaultOrderedDict(<class 'list'>, "
                      "DefaultOrderedDict([(1, [1]), (0, [0]), (2, [])]))")
>       self.assertEqual(repr(data), r_repr)
E       AssertionError: "Defa[19 chars]ss 'list'>, DefaultOrderedDict({1: [1], 0: [0], 2: []}))" != "Defa[19 chars]ss 'list'>, DefaultOrderedDict([(1, [1]), (0, [0]), (2, [])]))"
E       - DefaultOrderedDict(<class 'list'>, DefaultOrderedDict({1: [1], 0: [0], 2: []}))
E       ?                                                       ^ ^       ^       ^   ^
E       + DefaultOrderedDict(<class 'list'>, DefaultOrderedDict([(1, [1]), (0, [0]), (2, [])]))
E       ?                                                       ^^ ^    +  + ^    +  + ^   ^^

simplesat/utils/tests/test_collections.py:32: AssertionError
Full output
/home/maribu/Repos/software/aports/master/testing/py3-simplesat/src/testenv/lib/python3.12/site-packages/simplesat/package.py:68: SyntaxWarning: invalid escape sequence '\i'
  """ Return a new PackageMetdata object.
/home/maribu/Repos/software/aports/master/testing/py3-simplesat/src/testenv/lib/python3.12/site-packages/simplesat/constraints/package_parser.py:14: SyntaxWarning: invalid escape sequence '\w'
  CONSTRAINT_BLOCK_RC = re.compile("(?P<kind>\w+)\s*\((?P<constraints>.*?)\)")
/home/maribu/Repos/software/aports/master/testing/py3-simplesat/src/testenv/lib/python3.12/site-packages/simplesat/constraints/requirement.py:19: SyntaxWarning: invalid escape sequence '\s'
  _FULL_PACKAGE_RC = re.compile("""\
/home/maribu/Repos/software/aports/master/testing/py3-simplesat/src/testenv/lib/python3.12/site-packages/simplesat/sat/clause.py:75: SyntaxWarning: invalid escape sequence '\/'
  """For a conflicting clause, return the reason for propagating p.
===================================================== test session starts =====================================================
platform linux -- Python 3.12.3, pytest-8.2.2, pluggy-1.5.0 -- /home/maribu/Repos/software/aports/master/testing/py3-simplesat/src/testenv/bin/python3
cachedir: .pytest_cache
rootdir: /home/maribu/Repos/software/aports/master/testing/py3-simplesat/src/sat-solver-0.8.2
collected 230 items                                                                                                           

simplesat/constraints/tests/test_constraint_modifiers.py::TestConstraintModifiers::test_asdict PASSED                   [  0%]
simplesat/constraints/tests/test_constraint_modifiers.py::TestConstraintModifiers::test_initialization PASSED           [  0%]
simplesat/constraints/tests/test_constraint_modifiers.py::TestConstraintModifiers::test_remove PASSED                   [  1%]
simplesat/constraints/tests/test_constraint_modifiers.py::TestConstraintModifiers::test_targets PASSED                  [  1%]
simplesat/constraints/tests/test_constraint_modifiers.py::TestConstraintModifiers::test_update PASSED                   [  2%]
simplesat/constraints/tests/test_multi.py::TestConstraintMisc::test_comparison PASSED                                   [  2%]
simplesat/constraints/tests/test_multi.py::TestConstraintMisc::test_ensure_can_compare PASSED                           [  3%]
simplesat/constraints/tests/test_multi.py::TestConstraintMisc::test_hashing PASSED                                      [  3%]
simplesat/constraints/tests/test_multi.py::TestAreCompatible::test_simple_any PASSED                                    [  3%]
simplesat/constraints/tests/test_multi.py::TestAreCompatible::test_simple_enpkg_upstream_match PASSED                   [  4%]
simplesat/constraints/tests/test_multi.py::TestAreCompatible::test_simple_equal PASSED                                  [  4%]
simplesat/constraints/tests/test_multi.py::TestAreCompatible::test_simple_geq PASSED                                    [  5%]
simplesat/constraints/tests/test_multi.py::TestAreCompatible::test_simple_gt PASSED                                     [  5%]
simplesat/constraints/tests/test_multi.py::TestAreCompatible::test_simple_leq PASSED                                    [  6%]
simplesat/constraints/tests/test_multi.py::TestAreCompatible::test_simple_lt PASSED                                     [  6%]
simplesat/constraints/tests/test_multi.py::TestAreCompatible::test_simple_not PASSED                                    [  6%]
simplesat/constraints/tests/test_multi.py::TestMultiConstraints::test_comparison PASSED                                 [  7%]
simplesat/constraints/tests/test_multi.py::TestMultiConstraints::test_simple PASSED                                     [  7%]
simplesat/constraints/tests/test_package_parser.py::TestPrettyPackageStringParser::test_complicated PASSED              [  8%]
simplesat/constraints/tests/test_package_parser.py::TestPrettyPackageStringParser::test_conflicts_simple PASSED         [  8%]
simplesat/constraints/tests/test_package_parser.py::TestPrettyPackageStringParser::test_depends_simple PASSED           [  9%]
simplesat/constraints/tests/test_package_parser.py::TestPrettyPackageStringParser::test_invalid_formats PASSED          [  9%]
simplesat/constraints/tests/test_package_parser.py::TestPrettyPackageStringParser::test_multiple PASSED                 [ 10%]
simplesat/constraints/tests/test_package_parser.py::TestPrettyPackageStringParser::test_no_constraints PASSED           [ 10%]
simplesat/constraints/tests/test_package_parser.py::TestPrettyPackageStringParser::test_special_characters PASSED       [ 10%]
simplesat/constraints/tests/test_package_parser.py::TestPrettyPackageStringParser::test_unversioned PASSED              [ 11%]
simplesat/constraints/tests/test_package_parser.py::TestPackagePrettyString::test_complicated PASSED                    [ 11%]
simplesat/constraints/tests/test_package_parser.py::TestPackagePrettyString::test_conflicts PASSED                      [ 12%]
simplesat/constraints/tests/test_package_parser.py::TestPackagePrettyString::test_install_requires PASSED               [ 12%]
simplesat/constraints/tests/test_package_parser.py::TestPackagePrettyString::test_provides PASSED                       [ 13%]
simplesat/constraints/tests/test_package_parser.py::TestPackagePrettyString::test_simple PASSED                         [ 13%]
simplesat/constraints/tests/test_package_parser.py::TestToPackage::test_complicated PASSED                              [ 13%]
simplesat/constraints/tests/test_package_parser.py::TestToPackage::test_simple PASSED                                   [ 14%]
simplesat/constraints/tests/test_package_parser.py::TestToPackage::test_with_conflicts PASSED                           [ 14%]
simplesat/constraints/tests/test_package_parser.py::TestToPackage::test_with_depends PASSED                             [ 15%]
simplesat/constraints/tests/test_package_parser.py::TestToPackage::test_with_provides PASSED                            [ 15%]
simplesat/constraints/tests/test_package_parser.py::TestParseScaryPackages::test_pretty_package_parse PASSED            [ 16%]
simplesat/constraints/tests/test_package_parser.py::TestParseScaryPackages::test_requirement_parsing PASSED             [ 16%]
simplesat/constraints/tests/test_parser.py::Test_RawConstraintsParser::test_empty PASSED                                [ 16%]
simplesat/constraints/tests/test_parser.py::Test_RawConstraintsParser::test_invalid_string PASSED                       [ 17%]
simplesat/constraints/tests/test_parser.py::Test_RawConstraintsParser::test_multiple PASSED                             [ 17%]
simplesat/constraints/tests/test_parser.py::Test_RawConstraintsParser::test_simple PASSED                               [ 18%]
simplesat/constraints/tests/test_parser.py::Test_RawRequirementParser::test_invalid PASSED                              [ 18%]
simplesat/constraints/tests/test_parser.py::Test_RawRequirementParser::test_multiple PASSED                             [ 19%]
simplesat/constraints/tests/test_parser.py::Test_RawRequirementParser::test_multiple_names PASSED                       [ 19%]
simplesat/constraints/tests/test_parser.py::Test_RawRequirementParser::test_no_version PASSED                           [ 20%]
simplesat/constraints/tests/test_parser.py::Test_RawRequirementParser::test_simple PASSED                               [ 20%]
simplesat/constraints/tests/test_requirement.py::TestRequirementFromConstraint::test_any PASSED                         [ 20%]
simplesat/constraints/tests/test_requirement.py::TestRequirementFromConstraint::test_comparison PASSED                  [ 21%]
simplesat/constraints/tests/test_requirement.py::TestRequirementFromConstraint::test_disjunction_fails PASSED           [ 21%]
simplesat/constraints/tests/test_requirement.py::TestRequirementFromConstraint::test_has_any_version_constraint PASSED  [ 22%]
simplesat/constraints/tests/test_requirement.py::TestRequirementFromConstraint::test_hashing PASSED                     [ 22%]
simplesat/constraints/tests/test_requirement.py::TestRequirementFromConstraint::test_multiple_fails PASSED              [ 23%]
simplesat/constraints/tests/test_requirement.py::TestRequirementFromConstraint::test_simple PASSED                      [ 23%]
simplesat/constraints/tests/test_requirement.py::TestRequirementFromString::test_any PASSED                             [ 23%]
simplesat/constraints/tests/test_requirement.py::TestRequirementFromString::test_comparison PASSED                      [ 24%]
simplesat/constraints/tests/test_requirement.py::TestRequirementFromString::test_from_package_string PASSED             [ 24%]
simplesat/constraints/tests/test_requirement.py::TestRequirementFromString::test_has_any_version_constraint PASSED      [ 25%]
simplesat/constraints/tests/test_requirement.py::TestRequirementFromString::test_hashing PASSED                         [ 25%]
simplesat/constraints/tests/test_requirement.py::TestRequirementFromString::test_multiple_fails PASSED                  [ 26%]
simplesat/constraints/tests/test_requirement.py::TestRequirementFromString::test_simple PASSED                          [ 26%]
simplesat/constraints/tests/test_requirement.py::TestParsePackageFullName::test_simple PASSED                           [ 26%]
simplesat/constraints/tests/test_requirement.py::TestRequirement::test_repr PASSED                                      [ 27%]
simplesat/constraints/tests/test_requirement.py::TestRequirementModification::test_collapse_multiple_any PASSED         [ 27%]
simplesat/constraints/tests/test_requirement.py::TestRequirementModification::test_modify_multi PASSED                  [ 28%]
simplesat/constraints/tests/test_requirement.py::TestRequirementModification::test_modify_single PASSED                 [ 28%]
simplesat/constraints/tests/test_requirement.py::TestRequirementModification::test_newer_older_is_any PASSED            [ 29%]
simplesat/sat/tests/test_assignment_set.py::TestAssignmentSet::test_changelog PASSED                                    [ 29%]
simplesat/sat/tests/test_assignment_set.py::TestAssignmentSet::test_container PASSED                                    [ 30%]
simplesat/sat/tests/test_assignment_set.py::TestAssignmentSet::test_copy PASSED                                         [ 30%]
simplesat/sat/tests/test_assignment_set.py::TestAssignmentSet::test_getitem PASSED                                      [ 30%]
simplesat/sat/tests/test_assignment_set.py::TestAssignmentSet::test_num_assigned PASSED                                 [ 31%]
simplesat/sat/tests/test_assignment_set.py::TestAssignmentSet::test_starts_empty PASSED                                 [ 31%]
simplesat/sat/tests/test_assignment_set.py::TestAssignmentSet::test_value PASSED                                        [ 32%]
simplesat/sat/tests/test_minisat.py::TestClause::test_calculate_reason PASSED                                           [ 32%]
simplesat/sat/tests/test_minisat.py::TestClause::test_rewatch PASSED                                                    [ 33%]
simplesat/sat/tests/test_minisat.py::TestClause::test_rewatch_true PASSED                                               [ 33%]
simplesat/sat/tests/test_minisat.py::TestClause::test_rewatch_unit PASSED                                               [ 33%]
simplesat/sat/tests/test_minisat.py::TestMiniSATSolver::test_add_clause PASSED                                          [ 34%]
simplesat/sat/tests/test_minisat.py::TestMiniSATSolver::test_add_empty_clause PASSED                                    [ 34%]
simplesat/sat/tests/test_minisat.py::TestMiniSATSolver::test_add_unit_clause PASSED                                     [ 35%]
simplesat/sat/tests/test_minisat.py::TestMiniSATSolver::test_analyze_conflict_zm01 PASSED                               [ 35%]
simplesat/sat/tests/test_minisat.py::TestMiniSATSolver::test_analyze_lower_level PASSED                                 [ 36%]
simplesat/sat/tests/test_minisat.py::TestMiniSATSolver::test_analyze_same_level PASSED                                  [ 36%]
simplesat/sat/tests/test_minisat.py::TestMiniSATSolver::test_assume_cancel_roundtrip PASSED                             [ 36%]
simplesat/sat/tests/test_minisat.py::TestMiniSATSolver::test_cancel PASSED                                              [ 37%]
simplesat/sat/tests/test_minisat.py::TestMiniSATSolver::test_cancel_until PASSED                                        [ 37%]
simplesat/sat/tests/test_minisat.py::TestMiniSATSolver::test_cancel_zm01 PASSED                                         [ 38%]
simplesat/sat/tests/test_minisat.py::TestMiniSATSolver::test_enqueue PASSED                                             [ 38%]
simplesat/sat/tests/test_minisat.py::TestMiniSATSolver::test_propagate_conflict PASSED                                  [ 39%]
simplesat/sat/tests/test_minisat.py::TestMiniSATSolver::test_propagate_one_level PASSED                                 [ 39%]
simplesat/sat/tests/test_minisat.py::TestMiniSATSolver::test_propagate_with_unit_info PASSED                            [ 40%]
simplesat/sat/tests/test_minisat.py::TestMiniSATSolver::test_propagate_zm01 PASSED                                      [ 40%]
simplesat/sat/tests/test_minisat.py::TestMiniSATSolver::test_propagation_with_queue PASSED                              [ 40%]
simplesat/sat/tests/test_minisat.py::TestMiniSATSolver::test_propagation_with_queue_conflicted PASSED                   [ 41%]
simplesat/sat/tests/test_minisat.py::TestMiniSATSolver::test_propagation_with_queue_multiple_implications PASSED        [ 41%]
simplesat/sat/tests/test_minisat.py::TestMiniSATSolver::test_record_learned_clause PASSED                               [ 42%]
simplesat/sat/tests/test_minisat.py::TestMiniSATSolver::test_setup_does_not_overwrite_assignments PASSED                [ 42%]
simplesat/sat/tests/test_minisat.py::TestMiniSATSolver::test_undo_one PASSED                                            [ 43%]
simplesat/sat/tests/test_minisat.py::TestMiniSATSolver::test_validation PASSED                                          [ 43%]
simplesat/sat/tests/test_minisat_problems.py::TestMinisatProblems::test_no_assumptions PASSED                           [ 43%]
simplesat/sat/tests/test_minisat_problems.py::TestMinisatProblems::test_one_assumption PASSED                           [ 44%]
simplesat/sat/tests/test_minisat_problems.py::TestMinisatProblems::test_unit_assignments_are_remembered PASSED          [ 44%]
simplesat/sat/tests/test_minisat_problems.py::TestMinisatVanDerWaerden::test_van_der_waerden_not_solvable PASSED        [ 45%]
simplesat/sat/tests/test_minisat_problems.py::TestMinisatVanDerWaerden::test_van_der_waerden_solvable PASSED            [ 45%]
simplesat/tests/test_compute_dependencies.py::TestComputeDependencies::test_chained_requirements PASSED                 [ 46%]
simplesat/tests/test_compute_dependencies.py::TestComputeDependencies::test_chained_requirements_transitive PASSED      [ 46%]
simplesat/tests/test_compute_dependencies.py::TestComputeDependencies::test_no_dependency PASSED                        [ 46%]
simplesat/tests/test_compute_dependencies.py::TestComputeDependencies::test_simple_dependency PASSED                    [ 47%]
simplesat/tests/test_compute_dependencies.py::TestComputeReverseDependencies::test_chained_dependencies PASSED          [ 47%]
simplesat/tests/test_compute_dependencies.py::TestComputeReverseDependencies::test_chained_dependencies_transitive PASSED [ 48%]
simplesat/tests/test_compute_dependencies.py::TestComputeReverseDependencies::test_no_dependency PASSED                 [ 48%]
simplesat/tests/test_compute_dependencies.py::TestComputeReverseDependencies::test_simple_dependency PASSED             [ 49%]
simplesat/tests/test_compute_dependencies.py::TestComputeLeafPackages::test_simple PASSED                               [ 49%]
simplesat/tests/test_dependency_solver.py::TestRequirementsAreSatistifiable::test_constraint_modifiers PASSED           [ 50%]
simplesat/tests/test_dependency_solver.py::TestRequirementsAreSatistifiable::test_raises_if_unresolvable_requirement PASSED [ 50%]
simplesat/tests/test_dependency_solver.py::TestRequirementsAreSatistifiable::test_simple PASSED                         [ 50%]
simplesat/tests/test_dependency_solver.py::TestMinUnsat::test_conflicting_dependencies PASSED                           [ 51%]
simplesat/tests/test_dependency_solver.py::TestMinUnsat::test_conflicting_dependencies2 PASSED                          [ 51%]
simplesat/tests/test_dependency_solver.py::TestMinUnsat::test_more_than_2_clauses PASSED                                [ 52%]
simplesat/tests/test_dependency_solver.py::TestMinUnsat::test_raises_unexpectedly_satisfiable PASSED                    [ 52%]
simplesat/tests/test_dependency_solver.py::TestMinUnsat::test_simple PASSED                                             [ 53%]
simplesat/tests/test_pool.py::TestPool::test_accept_anyversion_constraint_on_provides_metadata PASSED                   [ 53%]
simplesat/tests/test_pool.py::TestPool::test_id_to_string PASSED                                                        [ 53%]
simplesat/tests/test_pool.py::TestPool::test_iter_package_ids PASSED                                                    [ 54%]
simplesat/tests/test_pool.py::TestPool::test_iter_packages PASSED                                                       [ 54%]
simplesat/tests/test_pool.py::TestPool::test_modification_what_provides PASSED                                          [ 55%]
simplesat/tests/test_pool.py::TestPool::test_reject_version_constraint_on_provides_metadata PASSED                      [ 55%]
simplesat/tests/test_pool.py::TestPool::test_what_provides_caret PASSED                                                 [ 56%]
simplesat/tests/test_pool.py::TestPool::test_what_provides_casing PASSED                                                [ 56%]
simplesat/tests/test_pool.py::TestPool::test_what_provides_multiple PASSED                                              [ 56%]
simplesat/tests/test_pool.py::TestPool::test_what_provides_simple PASSED                                                [ 57%]
simplesat/tests/test_repository.py::TestRepository::test_add_package PASSED                                             [ 57%]
simplesat/tests/test_repository.py::TestRepository::test_contains PASSED                                                [ 58%]
simplesat/tests/test_repository.py::TestRepository::test_find_package PASSED                                            [ 58%]
simplesat/tests/test_repository.py::TestRepository::test_find_packages PASSED                                           [ 59%]
simplesat/tests/test_repository.py::TestRepository::test_find_unavailable_package PASSED                                [ 59%]
simplesat/tests/test_repository.py::TestRepository::test_regression_185 PASSED                                          [ 60%]
simplesat/tests/test_repository.py::TestRepository::test_simple PASSED                                                  [ 60%]
simplesat/tests/test_repository.py::TestRepository::test_update PASSED                                                  [ 60%]
simplesat/tests/test_rules_generator.py::TestRulesGenerator::test_allow_newer_modification PASSED                       [ 61%]
simplesat/tests/test_rules_generator.py::TestRulesGenerator::test_conflicts PASSED                                      [ 61%]
simplesat/tests/test_rules_generator.py::TestRulesGenerator::test_missing_direct_conflicts_package PASSED               [ 62%]
simplesat/tests/test_rules_generator.py::TestRulesGenerator::test_missing_direct_dependencies_package PASSED            [ 62%]
simplesat/tests/test_rules_generator.py::TestRulesGenerator::test_missing_indirect_conflicts_package PASSED             [ 63%]
simplesat/tests/test_rules_generator.py::TestRulesGenerator::test_missing_indirect_dependencies_package PASSED          [ 63%]
simplesat/tests/test_rules_generator.py::TestRulesGenerator::test_prefer_installed PASSED                               [ 63%]
simplesat/tests/test_rules_generator.py::TestRulesGenerator::test_provides PASSED                                       [ 64%]
simplesat/tests/test_scenarios_policy.py::TestNoInstallSet::test_conflict_by_provides PASSED                            [ 64%]
simplesat/tests/test_scenarios_policy.py::TestNoInstallSet::test_conflicting_single_package_dependencies PASSED         [ 65%]
simplesat/tests/test_scenarios_policy.py::TestNoInstallSet::test_directly_implied_solution PASSED                       [ 65%]
simplesat/tests/test_scenarios_policy.py::TestNoInstallSet::test_ipython PASSED                                         [ 66%]
simplesat/tests/test_scenarios_policy.py::TestNoInstallSet::test_iris PASSED                                            [ 66%]
simplesat/tests/test_scenarios_policy.py::TestNoInstallSet::test_multiple_provides PASSED                               [ 66%]
simplesat/tests/test_scenarios_policy.py::TestNoInstallSet::test_no_candidate PASSED                                    [ 67%]
simplesat/tests/test_scenarios_policy.py::TestNoInstallSet::test_one_directly_implied_requirement PASSED                [ 67%]
simplesat/tests/test_scenarios_policy.py::TestNoInstallSet::test_simple_numpy PASSED                                    [ 68%]
simplesat/tests/test_scenarios_policy.py::TestNoInstallSet::test_simple_provides PASSED                                 [ 68%]
simplesat/tests/test_scenarios_policy.py::TestNoInstallSet::test_three_way_conflict PASSED                              [ 69%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_blocked_downgrade PASSED                                 [ 69%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_blocked_upgrade PASSED                                   [ 70%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_complex_numpy_downgrade PASSED                           [ 70%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_conflicts_simple PASSED                                  [ 70%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_constraint_modifiers PASSED                              [ 71%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_downgrade_conflict PASSED                                [ 71%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_epd_full_conflict PASSED                                 [ 72%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_installed_pkg_missing_in_remote PASSED                   [ 72%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_installed_pkg_missing_in_remote_not_requested PASSED     [ 73%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_ipython PASSED                                           [ 73%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_ipython_upgrade PASSED                                   [ 73%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_multiple_jobs PASSED                                     [ 74%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_no_prefer_installed PASSED                               [ 74%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_numpy_downgrade PASSED                                   [ 75%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_preserve_marked_packages PASSED                          [ 75%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_remove_marked_packages PASSED                            [ 76%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_remove_no_reverse_dependencies PASSED                    [ 76%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_remove_reverse_dependencies PASSED                       [ 76%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_simple_numpy PASSED                                      [ 77%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_simple_numpy_installed_upgrade PASSED                    [ 77%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_simple_update_single PASSED                              [ 78%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_soft_update_with_deps PASSED                             [ 78%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_update_all PASSED                                        [ 79%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_update_all_conflict PASSED                               [ 79%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_update_all_noop PASSED                                   [ 80%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_update_reverse_dependencies PASSED                       [ 80%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_update_reverse_dependencies_no_prefer_installed PASSED   [ 80%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_update_single PASSED                                     [ 81%]
simplesat/tests/test_scenarios_policy.py::TestInstallSet::test_upgrade_conflict PASSED                                  [ 81%]
simplesat/tests/test_solver.py::TestSolver::test_already_installed PASSED                                               [ 82%]
simplesat/tests/test_solver.py::TestSolver::test_missing_dependency_strict PASSED                                       [ 82%]
simplesat/tests/test_solver.py::TestSolver::test_missing_direct_dependency_fails PASSED                                 [ 83%]
simplesat/tests/test_solver.py::TestSolver::test_missing_indirect_dependency_fails PASSED                               [ 83%]
simplesat/tests/test_solver.py::TestSolver::test_multiple_installs PASSED                                               [ 83%]
simplesat/tests/test_solver.py::TestSolver::test_packages_are_consistent PASSED                                         [ 84%]
simplesat/tests/test_solver.py::TestSolver::test_packages_from_requirements PASSED                                      [ 84%]
simplesat/tests/test_solver.py::TestSolver::test_repository_is_not_consistent PASSED                                    [ 85%]
simplesat/tests/test_solver.py::TestSolver::test_requirements_are_complete PASSED                                       [ 85%]
simplesat/tests/test_solver.py::TestSolver::test_requirements_are_not_complete PASSED                                   [ 86%]
simplesat/tests/test_solver.py::TestSolver::test_requirements_are_not_satisfiable PASSED                                [ 86%]
simplesat/tests/test_solver.py::TestSolver::test_requirements_are_satisfiable PASSED                                    [ 86%]
simplesat/tests/test_solver.py::TestSolver::test_requirements_from_packages PASSED                                      [ 87%]
simplesat/tests/test_solver.py::TestSolver::test_satisfy_requirements PASSED                                            [ 87%]
simplesat/tests/test_solver.py::TestSolver::test_satisfy_requirements_fail PASSED                                       [ 88%]
simplesat/tests/test_solver.py::TestSolver::test_simple_dependency PASSED                                               [ 88%]
simplesat/tests/test_solver.py::TestSolver::test_simple_install PASSED                                                  [ 89%]
simplesat/tests/test_solver.py::TestSolver::test_simplify_requirements PASSED                                           [ 89%]
simplesat/tests/test_solver.py::TestSolver::test_strange_key_error_bug_on_failure PASSED                                [ 90%]
simplesat/tests/test_solver.py::TestSolver::test_up_to_date_package_choices PASSED                                      [ 90%]
simplesat/tests/test_solver.py::TestSolver::test_upgrade_fail PASSED                                                    [ 90%]
simplesat/tests/test_solver.py::TestSolver::test_upgrade_no_candidate PASSED                                            [ 91%]
simplesat/tests/test_solver.py::TestSolver::test_upgrade_simple PASSED                                                  [ 91%]
simplesat/tests/test_solver.py::TestSolverWithHint::test_direct_dependency_conflict PASSED                              [ 92%]
simplesat/tests/test_solver.py::TestSolverWithHint::test_no_conflict PASSED                                             [ 92%]
simplesat/tests/test_solver.py::TestSolverWithHint::test_upgrade_fail PASSED                                            [ 93%]
simplesat/tests/test_test_utils.py::TestRepositoryFactory::test_simple PASSED                                           [ 93%]
simplesat/tests/test_test_utils.py::TestScenario::test_from_filename PASSED                                             [ 93%]
simplesat/tests/test_test_utils.py::TestScenario::test_load_modifiers PASSED                                            [ 94%]
simplesat/tests/test_test_utils.py::TestScenario::test_modify_marked PASSED                                             [ 94%]
simplesat/tests/test_test_utils.py::TestScenario::test_simple PASSED                                                    [ 95%]
simplesat/tests/test_test_utils.py::TestScenario::test_simple_marked PASSED                                             [ 95%]
simplesat/tests/test_transaction.py::TestTransaction::test_operations PASSED                                            [ 96%]
simplesat/tests/test_transaction.py::TestTransaction::test_pretty_operations PASSED                                     [ 96%]
simplesat/utils/tests/test_collections.py::TestDefaultOrderedDict::test_copy PASSED                                     [ 96%]
simplesat/utils/tests/test_collections.py::TestDefaultOrderedDict::test_deepcopy PASSED                                 [ 97%]
simplesat/utils/tests/test_collections.py::TestDefaultOrderedDict::test_pickling PASSED                                 [ 97%]
simplesat/utils/tests/test_collections.py::TestDefaultOrderedDict::test_simple FAILED                                   [ 98%]
simplesat/utils/tests/test_graph.py::TestGraph::test_toposort PASSED                                                    [ 98%]
simplesat/utils/tests/test_graph.py::TestGraph::test_toposort_cycle PASSED                                              [ 99%]
simplesat/utils/tests/test_graph.py::TestGraph::test_transitive_neighbors PASSED                                        [ 99%]
simplesat/utils/tests/test_graph.py::TestDependencyGraph::test_package_lit_dependency_graph PASSED                      [100%]

========================================================== FAILURES ===========================================================
_____________________________________________ TestDefaultOrderedDict.test_simple ______________________________________________

self = <simplesat.utils.tests.test_collections.TestDefaultOrderedDict testMethod=test_simple>

    def test_simple(self):
        # Given
        data = DefaultOrderedDict(list)
    
        # When
        data[1].append(1)
        data[0].append(0)
    
        # Then
        self.assertEqual(list(data.keys()), [1, 0])
        self.assertEqual(data[0], [0])
        self.assertEqual(data[1], [1])
        self.assertEqual(data[2], [])
        if sys.version_info[0] == 2:
            r_repr = ("DefaultOrderedDict(<type 'list'>, "
                      "DefaultOrderedDict([(1, [1]), (0, [0]), (2, [])]))")
        else:
            r_repr = ("DefaultOrderedDict(<class 'list'>, "
                      "DefaultOrderedDict([(1, [1]), (0, [0]), (2, [])]))")
>       self.assertEqual(repr(data), r_repr)
E       AssertionError: "Defa[19 chars]ss 'list'>, DefaultOrderedDict({1: [1], 0: [0], 2: []}))" != "Defa[19 chars]ss 'list'>, DefaultOrderedDict([(1, [1]), (0, [0]), (2, [])]))"
E       - DefaultOrderedDict(<class 'list'>, DefaultOrderedDict({1: [1], 0: [0], 2: []}))
E       ?                                                       ^ ^       ^       ^   ^
E       + DefaultOrderedDict(<class 'list'>, DefaultOrderedDict([(1, [1]), (0, [0]), (2, [])]))
E       ?                                                       ^^ ^    +  + ^    +  + ^   ^^

simplesat/utils/tests/test_collections.py:32: AssertionError
====================================================== warnings summary =======================================================
simplesat/constraints/package_parser.py:14
  /home/maribu/Repos/software/aports/master/testing/py3-simplesat/src/sat-solver-0.8.2/simplesat/constraints/package_parser.py:14: SyntaxWarning: invalid escape sequence '\w'
    CONSTRAINT_BLOCK_RC = re.compile("(?P<kind>\w+)\s*\((?P<constraints>.*?)\)")

simplesat/package.py:68
  /home/maribu/Repos/software/aports/master/testing/py3-simplesat/src/sat-solver-0.8.2/simplesat/package.py:68: SyntaxWarning: invalid escape sequence '\i'
    """ Return a new PackageMetdata object.

simplesat/constraints/requirement.py:19
  /home/maribu/Repos/software/aports/master/testing/py3-simplesat/src/sat-solver-0.8.2/simplesat/constraints/requirement.py:19: SyntaxWarning: invalid escape sequence '\s'
    _FULL_PACKAGE_RC = re.compile("""\

simplesat/sat/clause.py:75
  /home/maribu/Repos/software/aports/master/testing/py3-simplesat/src/sat-solver-0.8.2/simplesat/sat/clause.py:75: SyntaxWarning: invalid escape sequence '\/'
    """For a conflicting clause, return the reason for propagating p.

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=================================================== short test summary info ===================================================
FAILED simplesat/utils/tests/test_collections.py::TestDefaultOrderedDict::test_simple - AssertionError: "Defa[19 chars]ss 'list'>, DefaultOrderedDict({1: [1], 0: [0], 2: []}))" != "Defa[19 chars]ss 'list'>, Def...
========================================== 1 failed, 229 passed, 4 warnings in 2.68s ==========================================

Steps to reproduce

It was actually run using Alpine Linux package builder, but the steps boil down to:

Replacing `assertRaisesRegexp` with `assertRaisesRegex` for compatibility with python >= 3.12
This replaces assertRaisesRegexp with assertRaisesRegex for compatibility with
python >= 3.12.
diff --color -rupN a/simplesat/constraints/tests/test_package_parser.py b/simplesat/constraints/tests/test_package_parser.py
--- a/simplesat/constraints/tests/test_package_parser.py	2019-10-08 14:40:38.000000000 +0200
+++ b/simplesat/constraints/tests/test_package_parser.py	2024-07-04 15:35:07.408091882 +0200
@@ -22,7 +22,7 @@ class TestPrettyPackageStringParser(unit
         r_message = "Invalid preamble: "
 
         # Then
-        with self.assertRaisesRegexp(ValueError, r_message):
+        with self.assertRaisesRegex(ValueError, r_message):
             parse(package_string)
 
         # Given
@@ -30,7 +30,7 @@ class TestPrettyPackageStringParser(unit
         r_message = "Invalid preamble: 'numpy'"
 
         # Then
-        with self.assertRaisesRegexp(ValueError, r_message):
+        with self.assertRaisesRegex(ValueError, r_message):
             parse(package_string)
 
         # Given
@@ -38,7 +38,7 @@ class TestPrettyPackageStringParser(unit
         r_message = ("Invalid preamble: ")
 
         # Then
-        with self.assertRaisesRegexp(ValueError, r_message):
+        with self.assertRaisesRegex(ValueError, r_message):
             parse(package_string)
 
         # Given
@@ -46,7 +46,7 @@ class TestPrettyPackageStringParser(unit
         r_message = ("Invalid preamble: ")
 
         # Then
-        with self.assertRaisesRegexp(ValueError, r_message):
+        with self.assertRaisesRegex(ValueError, r_message):
             parse(package_string)
 
         # Given
@@ -54,7 +54,7 @@ class TestPrettyPackageStringParser(unit
         r_message = ("Invalid preamble: ")
 
         # Then
-        with self.assertRaisesRegexp(ValueError, r_message):
+        with self.assertRaisesRegex(ValueError, r_message):
             parse(package_string)
 
         # Given
@@ -63,7 +63,7 @@ class TestPrettyPackageStringParser(unit
                      "Unknown constraint kind: 'disparages'")
 
         # When
-        with self.assertRaisesRegexp(ValueError, r_message):
+        with self.assertRaisesRegex(ValueError, r_message):
             parse(package_string)
 
     def test_depends_simple(self):
@@ -216,7 +216,7 @@ class TestPrettyPackageStringParser(unit
                      "Unknown constraint kind: 'conflits'")
 
         # Then
-        with self.assertRaisesRegexp(ValueError, r_message):
+        with self.assertRaisesRegex(ValueError, r_message):
             parse(package_string)
 
         # Given
diff --color -rupN a/simplesat/tests/test_pool.py b/simplesat/tests/test_pool.py
--- a/simplesat/tests/test_pool.py	2019-10-08 14:40:38.000000000 +0200
+++ b/simplesat/tests/test_pool.py	2024-07-04 15:35:07.411425195 +0200
@@ -166,7 +166,7 @@ class TestPool(unittest.TestCase):
             constraint_re = re.escape(constraint)
 
             # Then
-            with self.assertRaisesRegexp(InvalidConstraint, constraint_re):
+            with self.assertRaisesRegex(InvalidConstraint, constraint_re):
                 Pool([repository])
 
     def test_accept_anyversion_constraint_on_provides_metadata(self):

Then running:

    pkgver=0.8.2
    echo "version = '$pkgver'" > simplesat/_version.py
    echo "version_tuple = ($(echo $pkgver | sed -e 's/\./, /g'))" >> simplesat/_version.py

    rm -r old

    gpep517 build-wheel \
         --wheel-dir dist \
         --output-fd 3 3>&1 >&2

    python3 -m venv --clear --without-pip --system-site-packages ./testenv
    ./testenv/bin/python3 -m installer dist/*.whl

    env PATH="$(pwd)/testenv/bin:$PATH" ./testenv/bin/python3 \
        -m pytest -v
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

No branches or pull requests

1 participant