Skip to content

Commit 28f16f7

Browse files
authored
Merge pull request #60 from smarie/feature/59_pathlib_python35
Fixed pathlib+xdist issue with python35
2 parents 9ddc621 + df16e3a commit 28f16f7

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

docs/changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
### 1.10.4 - python 3.5 xdist bugfix
4+
5+
- Fixed issue with `pytest-xdist` and python 3.5: `pathlib` objects were not properly handled by other stdlib modules in this python version. Fixed [#59](https://github.com/smarie/python-pytest-harvest/issues/59)
6+
- Changed the layout
7+
38
### 1.10.3 - xdist bugfix + lazy `pandas` loading
49

510
- `pandas` is now only imported when used, to speed up boot time. Fixes [#49](https://github.com/smarie/python-pytest-harvest/issues/49)

pytest_harvest/plugin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,13 +401,13 @@ def __init__(self, config):
401401
def pytest_harvest_xdist_init(self):
402402
# reset the recipient folder
403403
if self.results_path.exists():
404-
rmtree(self.results_path)
404+
rmtree(str(self.results_path))
405405
self.results_path.mkdir(exist_ok=False)
406406
return True
407407

408408
@pytest.hookimpl(trylast=True)
409409
def pytest_harvest_xdist_worker_dump(self, worker_id, session_items, fixture_store):
410-
with open(self.results_path / ('%s.pkl' % worker_id), 'wb') as f:
410+
with open(str(self.results_path / ('%s.pkl' % worker_id)), 'wb') as f:
411411
try:
412412
pickle.dump((session_items, fixture_store), f)
413413
except Exception as e:
@@ -426,7 +426,7 @@ def pytest_harvest_xdist_load(self):
426426
@pytest.hookimpl(trylast=True)
427427
def pytest_harvest_xdist_cleanup(self):
428428
# delete all temporary pickle files
429-
rmtree(self.results_path)
429+
rmtree(str(self.results_path))
430430
return True
431431

432432

0 commit comments

Comments
 (0)