Desired capability setup for parallel execution in python with android

Hi Appium users/experts:

Problem statement: I am facing problem with parallel execution with real android devices. the script is getting successfully executed, it is able to launch the app under test in both the real devices but execute test actions in only one device.

I tried to googling it from last two weeks, could not find any help full documentation in python for parallel execution neither the official appium documentation, (http://appium.io/docs/en/advanced-concepts/parallel-tests/), more information is available in java. but not python. I am using linux. trying to debug this issue. please don’t give me already discussed topics link rather modify the below desired capabilities where i am making a mistake. I have done enough research before posting this discussion. Please help!!. Reply here if you need more information.

Python IDE: Pycharm
appium: v1.12.1
appium-python-client version: 0.41
I opened two command prompt windows in linux OS
cmd prompt1: appium -U “device id” -p 4723
cmd prompt2: appium -U “device id” -p 4733

def setUp(self):
desired_caps = {}
desired_capss[‘platformName’] = ‘Android’
desired_capss[‘platformVersion’] = ‘9’
desired_capss[‘deviceName’] = ‘Samsung J8’
desired_capss[‘Reset’] = ‘true’
desired_caps[‘appPackage’] = ‘com.google.xxx’
desired_caps[‘appActivity’] = ‘com.google.android.dialer.DialtactsActivity’
self.driver = webdriver.Remote(‘http://localhost:4723/wd/hub’, desired_caps)

    desired_caps = {}
    desired_capss['platformName'] = 'Android'
    desired_capss['platformVersion'] = '9'
    desired_capss['deviceName'] = 'Samsung J8'
    desired_capss['Reset'] = 'true'
    desired_caps['appPackage'] = 'com.google.xxx'
    desired_caps['appActivity'] = 'com.google.android.dialer.DialtactsActivity'
    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_case(self):
step1
step2
…step last
assert(true/false)