Python script runs perfect in PyCharm but in terminal don't
Question: I really don't understand... If you need screenshots of some settings please
tell me because I really don't know why it works in PyCharm but not outside
Pycharm...

    
    
    from selenium import webdriver
    from selenium.webdriver.support.ui import WebDriverWait
    import unittest
    from datetime import datetime
    
    class MYMaster(unittest.TestCase):
    
        def Test_login(self): 
    
    <<<<< MY CODE >>>>>
    
    if __name__ == '__main__':
    unittest.main()
    

If I right click in PyCharm on line `class MYMaster(unittest.TestCase):` and
select option **Run 'Unittest in MYMaster** ' it will send this code

    
    
    C:\Users\MyNameIs\AppData\Local\Programs\Python\Python35-32\python.exe"C:\Program Files (x86)\JetBrains\PyCharm 4.5.4\helpers\pycharm\utrunner.py" C:\Users\MyNameIs\PycharmProjects\untitled\MyProject\MyMain.py::MYMaster true
    Testing started at 15:42 ...
    
    Process finished with exit code 0
    Empty test suite.
    

If I right click on `def Test_login(self):`and select option **Run 'Unittest
TestLogin** ' it will send this code (But it runs entire code and give
results).

    
    
    C:\Users\MyNameIs\AppData\Local\Programs\Python\Python35-32\python.exe "C:\Program Files (x86)\JetBrains\PyCharm 4.5.4\helpers\pycharm\utrunner.py" C:\Users\MyNameIs\PycharmProjects\untitled\MyProject\MyMain.py::MYMaster::Test_login true
    Testing started at 15:50 ...
    
    Process finished with exit code 0
    

Now I decided to open the MyMain.py in Python IDLE where I clicked Run module
and this are the results:

    
    
    = RESTART: C:\Users\MyNameIs\PycharmProjects\untitled\MyProject\MyMain.py =
    
    ----------------------------------------------------------------------
    Ran 0 tests in 0.000s
    
    OK
    

> In Pycharm under Tool>Python Integrated Tools Default test runner =
> Unittests Docstring format = reStructuredText Checked checkbox Analyze
> Python code in docstrings


Answer: When you run `unittest`s in Pycharm, Pycharm provides a wrapper that executes
other code before your code.

To execute `unittest`s from the terminal, you should use this command,
provided that you have `python` set in your `PATH`:

`python -m unittest /path/to/script_with_tests.py`

You should also make sure that your functions' names start with `test`, ie
`test_login`.

From `unittest`
[documentation](https://docs.python.org/3.4/library/unittest.html):

> A testcase is created by subclassing unittest.TestCase. **The three
> individual tests are defined with methods whose names start with the letters
> test. This naming convention informs the test runner about which methods
> represent tests.**

