Frequently Asked Question
Press "Ctrl + F" to find the keyword of your interest.
If you wish to have a direct link access to the video timestamps, please follow these instructions.
Found this video helpful? Why not take the whole HIL Specialist course? A Certificate is waiting for you for free at HIL Academy.
Would you or your organization benefit from having these videos narrated in your native language? Contact us and let us know if you wish to contribute.
In this lesson, we will show some of the other TyphoonTest general functionalities,
such as the capability to run tests from different environments,
save default arguments, install libraries, and more.
The TyphoonTest allows you to choose the Python environment used to run the tests.
By default, it uses the Python provided with the Typhoon HIL Control Center installation.
You can find the default Python environment in your user files, for every installed release
of the Typhoon HIL Control Center. To check the available versions, open File Explorer,
type %appdata% on your folder bar and enter the typhoon folder. Here you can see the files for
each installation. The python environments are under the folder python portables ,
Scripts , and python.exe .These typhoon python environments
can be used from the command prompt with the typhoon-python command.
If you have multiple versions of THCC installed, the typhoon-python will run the last installed
version. To check which one will be used, you can either run the where command on cmd .
Or go into the windows environment variables, under the System Variable path :
Let s check all the available libraries installed with this environment.
For that, add the -m option after typhon-python and run the python commands as usual.
We can also install new libraries in this python environment.
Let s install the control library, for example.
It is important to highlight that the libraries installed will affect the python environment
used by THCC. Thus, the installation of some libraries or the change of their version might
cause issues when running Typhoon s software.That is why we provide the option to run
TyphoonTest with different environments, where you can install python libraries without worrying
about affecting the Python used by Typhoon. Let s run the tests with the system Python. First,
to see if we are using a Python version compatible with our version of THCC,
we need to check if we have TyphoonTest installed in our system Python:
Since we don t have it, we need to install TyphoonTest to run the tests with the system
Python. It is important to know that if you install it on your system Python and try to
run our Pytest Basics course, you will notice it will take longer to run the tests. That happens
because it will first open THCC and prepare all the report systems when running Pytest.
You can find the TyphoonTest Library on Pypi,
where you can check all the new releases and compatible Python versions.
By installing the TyphoonTest Library, it will automatically install all necessary libraries,
alongside the Typhoon HIL API Library.
After that, we are ready to run the tests with our system Python.
You can also use any custom environment if you
select custom and add the path to the python executable.
It is also possible to run the tests outside of the TyphoonTest IDE. It is important to
allow integration with Continuous Integration tools, like Jenkins. Let s run the tests from
the terminal. Go to the folder where you have your tests, open the command prompt,
and run pytest. If you want to use the Python provided by Typhoon, run with typhoon-python
-m pytest . If you want to run with the system Python, run with just pytest .
Here you will notice that we lost the live log and other features. That is because we
are missing some arguments. Press Ctrl+C twice or close the cmd to stop the test.
If you go back to the IDE while the test is running, it prints the exact
command used by the IDE. Let s copy this command and run it on the terminal.
Now we have the same result as when we are running it from the IDE. If you press Ctrl+C
twice the tests will stop, and the report will open with the tests already executed.
We can also add these options to a pytest.ini file.
Every time we run Pytest on this folder, it will add the parameters present in it.
In this final lesson, we learned in-depth how to use pytest, install libraries, use different
environments, and add the default options when running Pytest.
Thank you for watching!