prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Better pattern to use PYTEST_OPTIONS
  In #4095 we incorporate the usage of `PYTEST_OPTIONS` to define a set of options to be environment-dependent. This way, we can extend/override these options used only in tests from outside (for example, corporate repo).
  
  Although I like it, I had to write a hack to know if we are running in `readthedocs` or `readthedocsinc` to know which of these options has to be respected by `pytest`.
  
  The ugly code is at https://github.com/rtfd/readthedocs.org/pull/4095#discussion_r198927773 and we need to find a better pattern for this.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `readthedocs/conftest.py`
  Content:
  ```
  1 import pytest
  2 from rest_framework.test import APIClient
  3 
  4 
  5 try:
  6     # TODO: this file is read/executed even when called from ``readthedocsinc``,
  7     # so it's overriding the options that we are defining in the ``conftest.py``
  8     # from the corporate site. We need to find a better way to avoid this.
  9     import readthedocsinc
  10     PYTEST_OPTIONS = ()
  11 except ImportError:
  12     PYTEST_OPTIONS = (
  13         # Options to set test environment
  14         ('community', True),
  15         ('corporate', False),
  16         ('environment', 'readthedocs'),
  17     )
  18 
  19 
  20 def pytest_configure(config):
  21     for option, value in PYTEST_OPTIONS:
  22         setattr(config.option, option, value)
  23 
  24 
  25 @pytest.fixture(autouse=True)
  26 def settings_modification(settings):
  27     settings.CELERY_ALWAYS_EAGER = True
  28 
  29 
  30 @pytest.fixture
  31 def api_client():
  32     return APIClient()
  33
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/readthedocs/conftest.py b/readthedocs/conftest.py
  --- a/readthedocs/conftest.py
  +++ b/readthedocs/conftest.py
  @@ -1,32 +1,6 @@
   import pytest
   from rest_framework.test import APIClient
   
  -
  -try:
  -    # TODO: this file is read/executed even when called from ``readthedocsinc``,
  -    # so it's overriding the options that we are defining in the ``conftest.py``
  -    # from the corporate site. We need to find a better way to avoid this.
  -    import readthedocsinc
  -    PYTEST_OPTIONS = ()
  -except ImportError:
  -    PYTEST_OPTIONS = (
  -        # Options to set test environment
  -        ('community', True),
  -        ('corporate', False),
  -        ('environment', 'readthedocs'),
  -    )
  -
  -
  -def pytest_configure(config):
  -    for option, value in PYTEST_OPTIONS:
  -        setattr(config.option, option, value)
  -
  -
  -@pytest.fixture(autouse=True)
  -def settings_modification(settings):
  -    settings.CELERY_ALWAYS_EAGER = True
  -
  -
   @pytest.fixture
   def api_client():
       return APIClient()
  
verification_info: {"golden_diff": "diff --git a/readthedocs/conftest.py b/readthedocs/conftest.py\n--- a/readthedocs/conftest.py\n+++ b/readthedocs/conftest.py\n@@ -1,32 +1,6 @@\n import pytest\n from rest_framework.test import APIClient\n \n-\n-try:\n-    # TODO: this file is read/executed even when called from ``readthedocsinc``,\n-    # so it's overriding the options that we are defining in the ``conftest.py``\n-    # from the corporate site. We need to find a better way to avoid this.\n-    import readthedocsinc\n-    PYTEST_OPTIONS = ()\n-except ImportError:\n-    PYTEST_OPTIONS = (\n-        # Options to set test environment\n-        ('community', True),\n-        ('corporate', False),\n-        ('environment', 'readthedocs'),\n-    )\n-\n-\n-def pytest_configure(config):\n-    for option, value in PYTEST_OPTIONS:\n-        setattr(config.option, option, value)\n-\n-\n-@pytest.fixture(autouse=True)\n-def settings_modification(settings):\n-    settings.CELERY_ALWAYS_EAGER = True\n-\n-\n @pytest.fixture\n def api_client():\n     return APIClient()\n", "issue": "Better pattern to use PYTEST_OPTIONS\nIn #4095 we incorporate the usage of `PYTEST_OPTIONS` to define a set of options to be environment-dependent. This way, we can extend/override these options used only in tests from outside (for example, corporate repo).\r\n\r\nAlthough I like it, I had to write a hack to know if we are running in `readthedocs` or `readthedocsinc` to know which of these options has to be respected by `pytest`.\r\n\r\nThe ugly code is at https://github.com/rtfd/readthedocs.org/pull/4095#discussion_r198927773 and we need to find a better pattern for this.\n", "before_files": [{"content": "import pytest\nfrom rest_framework.test import APIClient\n\n\ntry:\n    # TODO: this file is read/executed even when called from ``readthedocsinc``,\n    # so it's overriding the options that we are defining in the ``conftest.py``\n    # from the corporate site. We need to find a better way to avoid this.\n    import readthedocsinc\n    PYTEST_OPTIONS = ()\nexcept ImportError:\n    PYTEST_OPTIONS = (\n        # Options to set test environment\n        ('community', True),\n        ('corporate', False),\n        ('environment', 'readthedocs'),\n    )\n\n\ndef pytest_configure(config):\n    for option, value in PYTEST_OPTIONS:\n        setattr(config.option, option, value)\n\n\n@pytest.fixture(autouse=True)\ndef settings_modification(settings):\n    settings.CELERY_ALWAYS_EAGER = True\n\n\n@pytest.fixture\ndef api_client():\n    return APIClient()\n", "path": "readthedocs/conftest.py"}], "after_files": [{"content": "import pytest\nfrom rest_framework.test import APIClient\n\n@pytest.fixture\ndef api_client():\n    return APIClient()\n", "path": "readthedocs/conftest.py"}]}