'i am getting pytest ERROR: Unrecognized arguments: -n 4 error, xdist is installed correctly

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
import pytest

def test_google():
    serv_obj = Service(r"path of chrome")
    driver = webdriver.Chrome(service=serv_obj)
    driver.get("https://www.google.com/")
    assert driver.title=="Google"
    driver.quit()

def test_naukri():
    serv_obj = Service(r"path of chrome")
    driver = webdriver.Chrome(service=serv_obj)
    driver.get("https://www.naukri.com/mnjuser/homepage")
    assert driver.title=="Jobseeker's Login: Search the Best Jobs available in India & Abroad - Naukri.com"
    driver.quit()

def test_gmail():
    serv_obj = Service(r"path of chrome")
    driver = webdriver.Chrome(service=serv_obj)
    driver.get("https://mail.google.com/mail/u/0/#inbox")
    assert driver.title=="Gmail"
    driver.quit()

def test_instagram():
    serv_obj = Service(r"path of chrome")
    driver = webdriver.Chrome(service=serv_obj)
    driver.get("https://www.instagram.com/")
    assert driver.title=="Instagram"
    driver.quit()

**
#this is my code, when i tried to parallel execution 'pytest My_directory/test_title.py -n 4', it gives error: ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...] pytest: error: unrecognized arguments: -n 4 inifile: C:\path\pytest.ini rootdir: C:\path\pythonProject\Pytest_Practice**



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source