Appium python: Not able to run parallel execution in two android real devices, test run only in one device, However, script could only launch app in other device

Hi Appium Users/experts

This is the fourth time in this series of replies. is this a forum for trail and error or providing a solution?
The same problem continues here. with zero progress. no solution at all. I would like to hear from those who ran and have hands on experience running the tests no just some knowledge. Please reply with tried and tested code and necessary steps or precondition to execution the code. Also, do escalate this discussion to next level for better clarity. I have posted this question after lots or google searches i could not get concrete information in python code. However i got few in java. @appium- Experts, I am anticipating your full answer with justifications, understand the problem with above information, Looking forward for your solution. Thanks in advance.

Side Note: I am not using ppium-uiautomator2-driver or chromedriver port. I am trying to automate a simple calculator app. not browser

https://appium.io/docs/en/advanced-concepts/parallel-tests/
This piece is of information is not helping at all. I would sugget, Edit this doc with some useful examples.

Problem Statement: I am not able to run parallel tests with python code. My script is able to launch the app in both the real devices but actions performed only in one device, Provided my script does no throw any error.

For starting appium server:
command prompt1: appium -U “Device id” -p 4723
command prompt2: appium -U “Device id” -p 4733

Script:

import unittest
from appium import webdriver

class Calc(unittest.TestCase):
def setUp(self):
desired_caps = {}
desired_caps[‘platformName’] = ‘Android’
desired_caps[‘systemPort’] = ‘8201’
desired_caps[‘platformVersion’] = ‘9’
desired_caps[‘deviceName’] = ‘21d873202904XXXx’
desired_caps[‘Reset’] = ‘true’
desired_caps[‘appPackage’] = ‘com.sec.android.app.popupcalculator’
desired_caps[‘appActivity’] = ‘com.sec.android.app.popupcalculator.Calculator’
self.driver = webdriver.Remote(‘http://localhost:4723/wd/hub’, desired_caps)

    desired_caps['platformName'] = 'Android'
    desired_caps['systemPort'] = '8202'
    desired_caps['platformVersion'] = '9'
    desired_caps['deviceName'] = 'f2ebAXXD'
    desired_caps['Reset'] = 'true'
    desired_caps['appPackage'] = 'com.sec.android.app.popupcalculator'
    desired_caps['appActivity'] = 'com.sec.android.app.popupcalculator.Calculator'
    self.driver1 = webdriver.Remote('http://localhost:4733/wd/hub', desired_caps)

def tearDown(self):
    self.driver.quit()

def tearDown(self):
    self.driver1.quit()

def test_text_friend(self):
    self.driver.find_element_by_id("com.sec.android.app.popupcalculator:id/bt_05").click()
    self.driver.find_element_by_id("com.sec.android.app.popupcalculator:id/bt_add").click()
    self.driver.find_element_by_id("com.sec.android.app.popupcalculator:id/bt_06").click()
    self.driver.find_element_by_id("com.sec.android.app.popupcalculator:id/bt_equal").click()
    candy = self.driver.find_element_by_id("com.sec.android.app.popupcalculator:id/txtCalc").text
    self.assertEqual("11", candy), "Element not found"

if name == 'main':
suite = unittest.TestLoader().loadTestsFromTestCase(Calc)
unittest.TextTestRunner(verbosity=2).run(suite)


Result:
----------
test_text_friend (main.Dialer) ... ok
Ran 1 test in 11.086s
OK

import unittest
from appium import webdriver

class Calc(unittest.TestCase):
def setUp(self):
desired_caps = {}
desired_caps[‘platformName’] = ‘Android’
desired_caps[‘systemPort’] = ‘8201’
desired_caps[‘platformVersion’] = ‘9’
desired_caps[‘deviceName’] = ‘21d873202904XXXx’
desired_caps[‘Reset’] = ‘true’
desired_caps[‘appPackage’] = ‘com.sec.android.app.popupcalculator’
desired_caps[‘appActivity’] = ‘com.sec.android.app.popupcalculator.Calculator’
self.driver = webdriver.Remote(‘http://localhost:4723/wd/hub’, desired_caps)

    desired_caps['platformName'] = 'Android'
    desired_caps['systemPort'] = '8202'
    desired_caps['platformVersion'] = '9'
    desired_caps['deviceName'] = 'f2ebAXXD'
    desired_caps['Reset'] = 'true'
    desired_caps['appPackage'] = 'com.sec.android.app.popupcalculator'
    desired_caps['appActivity'] = 'com.sec.android.app.popupcalculator.Calculator'
    self.driver1 = webdriver.Remote('http://localhost:4733/wd/hub', desired_caps)

def tearDown(self):
    self.driver.quit()

def tearDown(self):
    self.driver1.quit()

def test_text_friend(self):
    self.driver.find_element_by_id("com.sec.android.app.popupcalculator:id/bt_05").click()
    self.driver.find_element_by_id("com.sec.android.app.popupcalculator:id/bt_add").click()
    self.driver.find_element_by_id("com.sec.android.app.popupcalculator:id/bt_06").click()
    self.driver.find_element_by_id("com.sec.android.app.popupcalculator:id/bt_equal").click()
    candy = self.driver.find_element_by_id("com.sec.android.app.popupcalculator:id/txtCalc").text
    self.assertEqual("11", candy), "Element not found"

Please modify the above code and post it here. I really need help. Unable to run parallel execution.
I am using pycharm in linux, Appium: v1.12.1