test_python_pytest.py 613 B

12345678910111213141516171819
  1. import os
  2. from tests.package.test_python import TestPythonPackageBase
  3. class TestPythonPy3Pytest(TestPythonPackageBase):
  4. __test__ = True
  5. config = TestPythonPackageBase.config + \
  6. """
  7. BR2_PACKAGE_PYTHON3=y
  8. BR2_PACKAGE_PYTHON_PYTEST=y
  9. """
  10. sample_scripts = ["tests/package/sample_python_pytest.py"]
  11. def run_sample_scripts(self):
  12. for script in self.sample_scripts:
  13. cmd = self.interpreter + " -m pytest " + os.path.basename(script)
  14. _, exit_code = self.emulator.run(cmd, timeout=self.timeout)
  15. self.assertEqual(exit_code, 0)