nicoulaj / pytest-csv

CSV reporter for pytest.
GNU General Public License v3.0
21 stars 16 forks source link

Running tests with --csv cli option raising internal error with Flake8 tests #15

Closed abhijeetkaurav1st closed 3 years ago

abhijeetkaurav1st commented 3 years ago

When I run the command: pytest -s tests/next_demo/test_next_demo.py --csv tests.csv, Getting the below internal errors:

`INTERNALERROR> report._csv_rows = {column_id: dict(column(item, report)) if callable(column) else {column_id: str(column)}

INTERNALERROR> File "/Users/abhijeet.kaurav/Calm_repos/ideadevice-calm-dsl/venv/lib/python3.9/site-packages/pytest_csv/_reporter.py", line 46, in

INTERNALERROR> report._csv_rows = {column_id: dict(column(item, report)) if callable(column) else {column_id: str(column)}

INTERNALERROR> File "/Users/abhijeet.kaurav/Calm_repos/ideadevice-calm-dsl/venv/lib/python3.9/site-packages/pytest_csv/column/_builtin.py", line 58, in column_doc

INTERNALERROR> yield DOC, get_test_doc(item).strip()

INTERNALERROR> File "/Users/abhijeet.kaurav/Calm_repos/ideadevice-calm-dsl/venv/lib/python3.9/site-packages/pytest_csv/column/_utils.py", line 38, in get_test_doc

INTERNALERROR> return item.obj.doc or ''

INTERNALERROR> AttributeError: 'Flake8Item' object has no attribute 'obj'`

abhijeetkaurav1st commented 3 years ago

pytest version : 5.3.5 pytest-csv version : 2.0.2

abhijeetkaurav1st commented 3 years ago

But if I also supply --csv-columns, no error/warnings are raised