Repository: tellor-io/telliot-feeds (language: python)

Issue:
add mac commands for dev env setup
only windows/linux listed


Discussion / hints:

Fix patch:
diff --git a/docs/add-chain.md b/docs/add-chain.md
index 7c159258..c32ad58e 100644
--- a/docs/add-chain.md
+++ b/docs/add-chain.md
@@ -5,7 +5,7 @@
 - For testing reporting on your new chain, install `telliot-core` in editable mode `pip install -e ~/path/to/telliot-core` to include new chain support in that dependency. You may need to comment out the locked version of `telliot-core` in `setup.cfg` to do this, then install `telliot-feeds` in editable mode as well.
 
 ### Steps
-1. Skip this step if your chain is listed [here](https://github.com/mds1/multicall#multicall3-contract-addresses). If not, then deploy your own Multicall contract on your new chain. After, update `src/telliot_feeds/reporters/tips/__init__.py` to include that contract's address.
+1. Skip this entire first step if your chain is listed [here](https://github.com/mds1/multicall#multicall3-contract-addresses). If your chain was not listed at that link (already supported in the multicall package), then deploy your own Multicall contract on your new chain, and after, update `src/telliot_feeds/reporters/tips/__init__.py` to include that contract's address. Again, skip this step if your chain is listed [here](https://github.com/mds1/multicall#multicall3-contract-addresses).
 2. Add chain ID to `AUTOPAY_CHAINS` constant in `src/telliot_feeds/reporters/reporter_autopay_utils.py`.
 3. Make sure there's a datafeed for the chain's native token in `src/telliot_feeds/feeds/`. If there isn't, add one by following the steps [here](https://tellor-io.github.io/telliot-feeds/add-spot-price/).
 4. Support profit checks by updating `get_native_token_feed` in `src/telliot_feeds/utils/reporter_utils.py` to return the datafeed for your new chain's native token.
diff --git a/docs/add-spot-price.md b/docs/add-spot-price.md
index 081a7071..3f2d7ad1 100644
--- a/docs/add-spot-price.md
+++ b/docs/add-spot-price.md
@@ -45,7 +45,7 @@ eth_usd_median_feed = DataFeed(
 
 3. Add feed to `CATALOG_FEEDS` constant in `src/telliot_feeds/feeds/__init__.py`:
 ```python
-from telliot_feeds.feeds.eth_usd_feed import eth_usd_manual_feed
+from telliot_feeds.feeds.eth_usd_feed import eth_usd_median_feed
 
 CATALOG_FEEDS = {
     ...
@@ -60,3 +60,31 @@ SPOT_PRICE_PAIRS = [
     "ETH/USD",
 ]
 ```
+4. Test your new feed in `tests/feeds/`. For example, once you've created a datafeed for an `ETH/USD` spot price using an aggregate of a few price sourcees, create file `tests/feeds/test_eth_usd_feed.py`:
+```python
+import statistics
+
+import pytest
+
+from telliot_feeds.feeds.eth_usd_feed import eth_usd_median_feed
+
+
+@pytest.mark.asyncio
+async def test_eth_usd_median_feed(caplog):
+    """Retrieve median ETH/USD price."""
+    v, _ = await eth_usd_median_feed.source.fetch_new_datapoint()
+
+    assert v is not None
+    assert v > 0
+    assert (
+        "sources used in aggregate: 4" in caplog.text.lower() or "sources used in aggregate: 5" in caplog.text.lower()
+    )
+    print(f"ETH/USD Price: {v}")
+
+    # Get list of data sources from sources dict
+    source_prices = [source.latest[0] for source in eth_usd_median_feed.source.sources if source.latest[0]]
+
+    # Make sure error is less than decimal tolerance
+    assert (v - statistics.median(source_prices)) < 10**-6
+```
+5. Create a pull request to merge your changes into the `main` branch [here](https://github.com/tellor-io/telliot-feeds/compare).
diff --git a/docs/contributing.md b/docs/contributing.md
index 67afdef0..ff75bfcf 100644
--- a/docs/contributing.md
+++ b/docs/contributing.md
@@ -2,7 +2,7 @@
 
 ## Development Environment Setup
 
-*These instructions assume that a working Python interpreter (version >=3.8)
+*These instructions assume that a working Python interpreter (version >=3.9 & <3.10)
 is already installed on the system.*
 
 Clone telliot repositories to a local working directory:
@@ -16,6 +16,13 @@ Change directories:
 Create and activate a [virtual environment](https://docs.python.org/3/library/venv.html).  In this example, the virtual environment is 
 located in a subfolder called `tenv`:
 
+=== "Mac"
+
+    ```
+    python3.9 -m venv tenv
+    source tenv/bin/activate
+    ```
+
 === "Linux"
 
     ```


Test patch:
diff --git a/tests/feeds/test_eth_usd_feed.py b/tests/feeds/test_eth_usd_feed.py
index aedf6624..f01cfc9e 100644
--- a/tests/feeds/test_eth_usd_feed.py
+++ b/tests/feeds/test_eth_usd_feed.py
@@ -6,12 +6,15 @@
 
 
 @pytest.mark.asyncio
-async def test_AssetPriceFeed():
+async def test_eth_usd_median_feed(caplog):
     """Retrieve median ETH/USD price."""
     v, _ = await eth_usd_median_feed.source.fetch_new_datapoint()
 
     assert v is not None
     assert v > 0
+    assert (
+        "sources used in aggregate: 4" in caplog.text.lower() or "sources used in aggregate: 5" in caplog.text.lower()
+    )
     print(f"ETH/USD Price: {v}")
 
     # Get list of data sources from sources dict