I am writing some python x selenium unit tests for the login functionality of a website. I have already written a unit test for a valid login, but I want to write one for the "Remember Me" functionality. I could easily just copy/paste the login unit test code into the new one, but that would make a VERY long block of code. I was wondering if there was any way to utilize another unit test's code for a separate unit test in order to save some room.
It's not about utilization unit tests.
You should write your methods / classes in a way they can be utilized easily.
So that your login method will call similar methods that "remember me" method uses but with appropriate changes according to scenario flow differences.
Is there a way to run a unit test inside a different unit test?