Frequently Asked Question

Video: 6.4.5 Other functionalities
Last Updated 3 years ago


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.

TRANSCRIPT

00:00:02

In this lesson, we will show some of the other TyphoonTest general functionalities,  

00:00:07

such as the capability to run tests from different environments,  

00:00:10

save default arguments, install libraries, and more. 

00:00:14

The TyphoonTest allows you to choose the Python environment used to run the tests.  

00:00:19

By default, it uses the Python provided with the Typhoon HIL Control Center installation. 

00:00:26

You can find the default Python environment in your user files, for every installed release  

00:00:31

of the Typhoon HIL Control Center. To check the available versions, open File Explorer,  

00:00:36

type %appdata% on your folder bar and enter the typhoon folder. Here you can see the files for  

00:00:43

each installation. The python environments are under the folder python portables ,  

00:00:50

Scripts , and python.exe .These typhoon python environments  

00:00:58

can be used from the command prompt with the typhoon-python command. 

00:01:08

If you have multiple versions of THCC installed, the typhoon-python will run the last installed  

00:01:14

version. To check which one will be used, you can either run the where command on cmd . 

00:01:22

Or go into the windows environment variables, under the System Variable path : 

00:01:35

Let s check all the available libraries installed with this environment.  

00:01:39

For that, add the -m option after typhon-python and run the python commands as usual.

00:01:59

We can also install new libraries in this python environment.  

00:02:02

Let s install the control library, for example. 

00:02:15

It is important to highlight that the libraries installed will affect the python environment  

00:02:19

used by THCC. Thus, the installation of some libraries or the change of their version might  

00:02:26

cause issues when running Typhoon s software.That is why we provide the option to run  

00:02:31

TyphoonTest with different environments, where you can install python libraries without worrying  

00:02:36

about affecting the Python used by Typhoon. Let s run the tests with the system Python. First,  

00:02:42

to see if we are using a Python version compatible with our version of THCC,  

00:02:47

we need to check if we have TyphoonTest installed in our system Python: 

00:02:52

Since we don t have it, we need to install TyphoonTest to run the tests with the system  

00:02:56

Python. It is important to know that if you install it on your system Python and try to  

00:03:01

run our Pytest Basics course, you will notice it will take longer to run the tests. That happens  

00:03:07

because it will first open THCC and prepare all the report systems when running Pytest. 

00:03:13

You can find the TyphoonTest Library on Pypi,  

00:03:17

where you can check all the new releases and compatible Python versions. 

00:03:26

By installing the TyphoonTest Library, it will automatically install all necessary libraries,  

00:03:32

alongside the Typhoon HIL API Library.

00:03:59

After that, we are ready to run the tests with our system Python.

00:04:21

You can also use any custom environment if you  

00:04:23

select custom and add the path to the python executable.

00:04:57

It is also possible to run the tests outside of the TyphoonTest IDE. It is important to  

00:05:02

allow integration with Continuous Integration tools, like Jenkins. Let s run the tests from  

00:05:08

the terminal. Go to the folder where you have your tests, open the command prompt,  

00:05:12

and run pytest. If you want to use the Python provided by Typhoon, run with typhoon-python  

00:05:19

-m pytest . If you want to run with the system Python, run with just pytest . 

00:05:26

Here you will notice that we lost the live log and other features. That is because we  

00:05:31

are missing some arguments. Press Ctrl+C twice or close the cmd to stop the test. 

00:05:37

If you go back to the IDE while the test is running, it prints the exact  

00:05:41

command used by the IDE. Let s copy this command and run it on the terminal. 

00:05:59

Now we have the same result as when we are running it from the IDE. If you press Ctrl+C  

00:06:04

twice the tests will stop, and the report will open with the tests already executed. 

00:06:12

We can also add these options to a pytest.ini file.  

00:06:16

Every time we run Pytest on this folder, it will add the parameters present in it.

00:06:48

In this final lesson, we learned in-depth how to use pytest, install libraries, use different  

00:06:54

environments, and add the default options when running Pytest.

00:06:58

Thank you for watching!

Please Wait!

Please wait... it will take a second!