Failing test_canonicalises_to_equivalent_fixpoint

Ouverte
#64 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
35/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
python
Domaine
testing

Piste de recherche

Start with the failing test in tests/test_canonicalise.py at line 45 and reproduce it using the schema in the issue. Compare the results of the first and second calls to canonicalise to locate why the schema changes again. Done means the test passes with the canonicalized schema unchanged on the second call.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Currently the test_canonicalises_to_equivalent_fixpoint test fails on assert cc == canonicalish(cc) with the following schema:

schema = {'not': {'anyOf': [{'type': 'number'}, {'if': {'type': 'null'}, 'then': {'type': 'null'}, 'else': {}}]}}

As far as I see, calling canonicalise second time should not transform the schema again. But here is schema after the first call:

{
    "not": {"anyOf": [{"const": None}, {"not": {"const": None}}]},
    "type": ["null", "boolean", "string", "array", "object"],
}

and after the second call:

{
    "not": {
        "anyOf": [
            {"const": None},
            {
                "type": ["null", "boolean", "string", "array", "object"],
                "not": {"const": None},
            },
        ]
    },
    "type": ["null", "boolean", "string", "array", "object"],
}

git bisect gave me this commit - afc292b9a2873a0c33176e61829c3dde25139333

Should the second call leave the input schema as is?

Langage dominant
Python
Étoiles
281
Forks
35
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de python-jsonschema/hypothesis-jsonschema

Toutes les issues de python-jsonschema/hypothesis-jsonschema

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.