kennethreitz/requests — pull request #432 by christopherwright (2012-02-15 12:59:03+00:00)
Title: Use correct path when opening file in tests

When running `make test`, several tests failed with a similar error:

```bash
$ make test
nosetests --with-color ./tests/*
............EEE..............................................EEE...................................................EEE..................................
======================================================================
ERROR: test_POSTBIN_GET_POST_FILES (test_requests_async.RequestsTestSuite)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/unittest/case.py", line 327, in run
testMethod()
File "/home/christopher/code/requests/tests/test_requests.py", line 294, in test_POSTBIN_GET_POST_FILES
with open('test_requests.py') as f:
IOError: [Errno 2] No such file or directory: 'test_requests.py'

(...)

----------------------------------------------------------------------
Ran 152 tests in 11.122 seconds
FAILED (errors=9)
```

The problem was that the current working directory was the root of the project, so calling `open('test_requests.py')` failed because it's now in the tests directory.

After the fix:

```bash
$ make test
nosetests --with-color ./tests/*
................................................................................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 304 tests in 19.953 seconds
OK
```