Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8334749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:27:10+00:00 2026-06-09T03:27:10+00:00

I have the following test directory structure and each has their own conftest.py: tests/api

  • 0

I have the following test directory structure and each has their own conftest.py:

    tests/api
    tests/api/newapi
    tests/sanity

In conftest.py, pytest_addoption has identical option entry as test_option:

parser.addoption(“–test_option”, dest=”test_option”, type=”string”, help=”test_option”)

Execute py.test at tests/api/newapi has following error:

optparse.OptionConflictError: option –test_option: conflicting option string(s): –test_option

But execute py.test at tests/api or tests or tests/sanity works fine.
Is this by design that I must come up with a new option name if the parent directory has same option name?

I was hoping that I can keep the naming convention the same since the option in question serve the same purpose for the test. The intent is to vary the level of detail in testing depending on which directory the test was kicked off from.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T03:27:12+00:00Added an answer on June 9, 2026 at 3:27 am

    I think you should have one tests/conftest.py which defines the option via pytest_addoption and you will be able to access it from everywhere because all conftest.py files are considered (so you might still have at tests/newapi/conftest.py and use the option value).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following directory structure. root --src ---tests src contains the source &
I have the following scenario- Pig version used 0.70 Sample HDFS directory structure: /user/training/test/20100810/<data
This is a python newbie question: I have the following directory structure: test --
If, for example, I have a directory which contains the following files: Test-20120626-1023.txt Test-20120626-0710.txt
I currently have the following directory structure for my code: src |-- main |
On localhost. I have the following directory structure: /share/www/trunk/wp-content/plugins/otherfolders /share/www/portfolio/wp-content/symlink Where symlink is a
I have a directory structure with the following on localhost: http://localhost/testing/ A directory structure
I have an Eclipse project with the following directory structure: MyProj >> src/main/java >>
I'm using Mercurial and I have a following structure: files test demo.jpg video.flv video.doc
I have the following Array : Array { [0]=>www.abc.com/directory/test; [1]=>www.abc.com/test; [2]=>www.abc.com/directory/test; [3]=>www.abc.com/test; } I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.