alex / alex/rply

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

Aberta
#26 2 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Python
Estrelas
391
Forks
62
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

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?

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.