Support Testing of Python Measures with standard OpenStudio install #4906
Labels
Enhancement Request
Triage
Issue needs to be assessed and labeled, further information on reported might be needed
Milestone
Enhancement Request
example Python measures included with OpenStudio use
pytest
for the measure tests.pytest
isn't included in the EnergyPlus Python that is used by the OpenStudio CLI whenopenstudio labs my_test.py
is run.Detailed Description
While a clean OpenStudio installer can run OSW file with labs that runs fine, there isn't way currently to run measure tests. We want to make it easy for novice measure writes to write and use tests when developing or altering Python measures, as we have done for Ruby measures. The goal here is to provide update the example measure tests, and make any changes necessary so the example Python measure, and other Python measures that do not use external packages can be tested with out of the box OpenStudio installer.
Possible Implementation
Preferred solution is to change to use
unittest
and fix issues that exist. When I try toimport unittest
on non-developer mac OpenStudio I get the following error. I have not tested on Windows.If we can't get
unittest
to work, it would be fine as an alternative to addpytest
to OpenStudio's Python, so that the existing example Python Measure tests work as written.The text was updated successfully, but these errors were encountered: