Skip to content

Commit b66a81a

Browse files
authored
Merge pull request #27 from nicoddemus/race-condition-on-collect-hotfix
Race condition on collect hotfix
2 parents c32675e + 545488f commit b66a81a

4 files changed

Lines changed: 7 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.4.2 #
2+
3+
- Proper fix for #25, the fix made in `0.4.1` was incorrect.
4+
15
# 0.4.1 #
26

37
- Fix error that may happen during collection when using xdist (#25).

pytest_cpp/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def pytest_collect_file(parent, path):
1717
is_executable = os.stat(str(path)).st_mode & stat.S_IXUSR
1818
except OSError:
1919
# in some situations the file might not be available anymore at this point
20-
return False
20+
is_executable = False
2121
if not is_executable:
2222
return
2323
masks = parent.config.getini('cpp_files') or DEFAULT_MASKS

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
setup(
55
name="pytest-cpp",
6-
version='0.4.1',
6+
version='0.4.2',
77
packages=['pytest_cpp'],
88
entry_points={
99
'pytest11': ['cpp = pytest_cpp.plugin'],

tests/test_pytest_cpp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def test_race_condition_on_collect(tmpdir):
254254
'/../test_duplicate_filenames.cpython-27-PYTEST.pyc.21746'
255255
"""
256256
import pytest_cpp.plugin
257-
assert not pytest_cpp.plugin.pytest_collect_file(None, tmpdir / 'invalid-file')
257+
assert pytest_cpp.plugin.pytest_collect_file(None, tmpdir / 'invalid-file') is None
258258

259259

260260
class TestError:

0 commit comments

Comments
 (0)