alex / alex/rply

test failures in 0.7.2; test_simple, test_empty_production under py3[3-4]

Ouverte
#26 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
391
Forks
62
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

from the source, with system python set to Python 3.3.5;

rply-0.7.2 $ py.test tests/

yields

``` python
======================== test session starts
========================
platform linux -- Python 3.3.5 -- py-1.4.20 -- pytest-2.5.2
collected 35 items / 1 skipped

tests/test_both.py .
tests/test_lexer.py ...
tests/test_parser.py ..........
tests/test_parsergenerator.py FF.......
tests/test_tokens.py ...
tests/test_utils.py .....
tests/test_warnings.py ....

========================== FAILURES
==========================
_________________________ TestParserGenerator.test_simple
_________________________
self =

def test_simple(self):
pg = ParserGenerator(["VALUE"])

@pg.production("main : VALUE")
def main(p):
return p[0]

parser = pg.build()

> assert parser.lr_table.lr_action == [
{"VALUE": 2},
{"$end": 0},
{"$end": -1},
]
E assert [{'VALUE': 1}..., {'$end': 0}] == [{'VALUE': 2},... {'$end': -1}]
E At index 0 diff: {'VALUE': 1} != {'VALUE': 2}

tests/test_parsergenerator.py:19: AssertionError
______________________ TestParserGenerator.test_empty_production
______________________

self =
def test_empty_production(self):
pg = ParserGenerator(["VALUE"])

@pg.production("main : values")
def main(p):
return p[0]

@pg.production("values : VALUE values")
def values_value(p):
return [p[0]] + p[1]

@pg.production("values :")
def values_empty(p):
return []

parser = pg.build()
> assert parser.lr_table.lr_action == [
{"$end": -3, "VALUE": 3},
{"$end": 0},
{"$end": -1},
{"$end": -3, "VALUE": 3},
{"$end": -2},
]
E assert [{'$end': -3,... {'$end': -2}] == [{'$end': -3, ... {'$end': -2}]
E At index 0 diff: {'VALUE': 1, '$end': -3} != {'VALUE': 3, '$end': -3}
```

with system Python 3.4.0

``` python
tests/test_parsergenerator.py FF.......

__ TestParserGenerator.test_simple __
```

as for Python 3.3.5

``` python
__ TestParserGenerator.test_empty_production __

> assert parser.lr_table.lr_action == [
{"$end": -3, "VALUE": 3},
{"$end": 0},
{"$end": -1},
{"$end": -3, "VALUE": 3},
{"$end": -2},
]
E assert [{'$end': -3,... {'$end': -2}] == [{'$end': -3, ... {'$end': -2}]
E At index 0 diff: {'VALUE': 2, '$end': -3} != {'$end': -3, 'VALUE': 3}

tests/test_parsergenerator.py:41: AssertionError
```

Can you replicate? py3.2 passes fine. These may be python minor version sensitive.
Do you require anything further?

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

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