alex / alex/rply

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

未關閉
#26 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
391
分支
62
PR 合併指標
30 天內沒有已合併 PR

描述

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?

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。