diff --git a/changelog/623.bugfix.rst b/changelog/623.bugfix.rst new file mode 100644 index 0000000..13397f9 --- /dev/null +++ b/changelog/623.bugfix.rst @@ -0,0 +1 @@ +Gracefully handle the pending deprecation of Node.fspath by using config.rootpath for topdir. diff --git a/src/xdist/remote.py b/src/xdist/remote.py index aaa45be..9aaf91b 100644 --- a/src/xdist/remote.py +++ b/src/xdist/remote.py @@ -93,9 +93,14 @@ class WorkerInteractor: ) def pytest_collection_finish(self, session): + try: + topdir = str(self.config.rootpath) + except AttributeError: # pytest <= 6.1.0 + topdir = str(self.config.rootdir) + self.sendevent( "collectionfinish", - topdir=str(session.fspath), + topdir=topdir, ids=[item.nodeid for item in session.items], )