obspy/obspy — pull request #678 by megies (2013-11-09 11:38:52+00:00)
Title: test_full_seed_with_non_default_dataquality failing with strange behavior

On my installation (OS X 10.9, Python 2.7.5, ObsPy HEAD), `test_full_seed_with_non_default_dataquality` currently fails in a very strange way:

```
$ python test_mseed_special_issues.py
....F.....................
======================================================================
FAIL: test_full_seed_with_non_default_dataquality (__main__.MSEEDSpecialIssueTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_mseed_special_issues.py", line 618, in test_full_seed_with_non_default_dataquality
self.assertEqual(len(st), 1)
AssertionError: 2 != 1

----------------------------------------------------------------------
Ran 26 tests in 0.370s

FAILED (failures=1)
```
For some reason, the length of `st`, defined [here] is equal to `2`, when tested [two lines later].

The very odd thing is that the test seems to fail randomly: sometimes it actually succeeds :confused:

Adding after [line 616] the following lines:
```python
print st
print len(st)
```

I get sometimes:
```
2 Trace(s) in Stream:
GE.APE..BHN | 2009-10-01T14:21:38.505000Z - 2009-10-01T14:22:08.555000Z | 20.0 Hz, 602 samples
GE.APE..BHZ | 2009-10-01T14:21:34.445000Z - 2009-10-01T14:22:05.545000Z | 20.0 Hz, 623 samples
2
```
The second trace is actually the second trace of the [previously defined] `st` object.

However, other times I get correctly:
```
1 Trace(s) in Stream:
GE.APE..BHN | 2009-10-01T14:21:38.505000Z - 2009-10-01T14:22:08.555000Z | 20.0 Hz, 602 samples
1
```
And the test succeeds.

I tried adding a:
```python
del st
```
To delete the previously created `st` object, but without any success.

Maybe it is some oddity in my installation.
However, just to be sure, I recompiled Python (through homebrew) and completely removed and re-installed ObsPy.

Can this be related to the fact that those seed files have the same data, with just a different data quality flag?

@krischer Can you reproduce this on your Mac?

[here]: https://github.com/obspy/obspy/blob/master/obspy/mseed/tests/test_mseed_special_issues.py#L616
[two lines later]: https://github.com/obspy/obspy/blob/master/obspy/mseed/tests/test_mseed_special_issues.py#L618
[line 616]: https://github.com/obspy/obspy/blob/master/obspy/mseed/tests/test_mseed_special_issues.py#L616
[previously defined]:
https://github.com/obspy/obspy/blob/master/obspy/mseed/tests/test_mseed_special_issues.py#L610