diff --git a/changelog/623.bugfix.rst b/changelog/623.bugfix.rst new file mode 100644 index 00000000..107d188d --- /dev/null +++ b/changelog/623.bugfix.rst @@ -0,0 +1 @@ +Gracefully handle the pending deprecation of Node.fspath by using config.rootpath for topdir. \ No newline at end of file diff --git a/src/xdist/remote.py b/src/xdist/remote.py index aaa45bed..0c739c84 100644 --- a/src/xdist/remote.py +++ b/src/xdist/remote.py @@ -93,9 +93,14 @@ def run_one_test(self, torun): ) 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], )