# TypeError: test_foo() missing 1 required positional argument: 'mock_open'

- **ID:** `python/unittest-patch-decorator-argument-order`
- **Domain:** python
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Multiple @patch decorators inject mocks in bottom-up order, but the test signature lists them top-down, so arguments are bound to the wrong parameters.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.8 | active | — | — |
| 3.12 | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   @patch('myapp.db.open')
@patch('myapp.fs.read')
def test_foo(mock_read, mock_open):
    # mock_read corresponds to the bottom decorator
    ...
   ```
2. **** (90% success)
   ```
   def test_foo():
    with patch('myapp.fs.read') as mock_read, \
         patch('myapp.db.open') as mock_open:
        ...
   ```

## Dead Ends

- **** — Fixes one test but the convention is undocumented; other tests in the file break the same way. (50% fail)
- **** — Mocks are positional; *args swallows them but makes assertions awkward and hides binding bugs. (60% fail)
