I have built a very simple set of tests that I'm trying to generate a report for to get the feel of things with Pytest. The report generates as expected, but there is no environment information, and, more importantly, there are no tests in the results table. Here are my tests:
import pytest
import time
# python -m pytest -v -s --html=report.html --self-contained-html test_pytest.py
class TestReports:
@pytest.fixture
def setup(self):
pass
def test_1(self, setup):
time.sleep(2)
assert True
def test_2(self, setup):
time.sleep(2)
assert False
I tried removing the -s command already, and I can't seem to find anything useful online yet. Any idea why tests will not appear in the table (or why the environment details are not present)? Forgive me if it is something obvious.
I'm still using
pytest==2.0.1because I found all later versions to have at least one bug that I wasn't willing to accept. Here's the report that was generated after running your script with that version: