Both ways work:
os.path.join(os.path.dirname(__file__), '..', '..', '..', 'testdata'))
First is shorter. Is there any reason to use 2nd syntax?
The only noticeable difference is that in the second example you let the os library take care of choosing the directory separator. This can be useful to prevent conflicts between different operating systems, though this shouldn't usually be a problem.
I would vote for the second option.