[Pytest-commit] Issue #479: Race condition on SkipTest checks (hpk42/pytest)

Marc Schlaich issues-reply at bitbucket.org
Fri Mar 7 11:20:10 CET 2014


New issue 479: Race condition on SkipTest checks
https://bitbucket.org/hpk42/pytest/issue/479/race-condition-on-skiptest-checks

Marc Schlaich:

There is a race condition in checking SkipTest: If the module with SkipTest (unittest or nose) was not imported before and a test module is raising SkipTest on module level, the whole thing blows up.

Example: test_x.py (and nothing else in cwd).


```
#!python

import unittest
raise unittest.SkipTest
```

Results in


```
$ py.test
============================= test session starts =============================
platform win32 -- Python 2.7.5 -- py-1.4.20 -- pytest-2.5.2
plugins: cov
collected 0 items / 1 errors

=================================== ERRORS ====================================
_________________________ ERROR collecting test_x.py __________________________
test_x.py:2: in <module>
>   raise unittest.SkipTest
E   SkipTest
=========================== 1 error in 0.04 seconds ===========================
```




More information about the pytest-commit mailing list