File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -90,8 +90,16 @@ def _getrsyncdirs(self):
9090 import pytest
9191 import _pytest
9292
93- pytestpath = pytest .__file__ .rstrip ("co" )
94- pytestdir = py .path .local (_pytest .__file__ ).dirpath ()
93+ def get_dir (p ):
94+ """Return the directory path if p is a package or the path to the .py file otherwise."""
95+ stripped = p .rstrip ("co" )
96+ if os .path .basename (stripped ) == "__init__.py" :
97+ return os .path .dirname (p )
98+ else :
99+ return stripped
100+
101+ pytestpath = get_dir (pytest .__file__ )
102+ pytestdir = get_dir (_pytest .__file__ )
95103 config = self .config
96104 candidates = [py ._pydir , pytestpath , pytestdir ]
97105 candidates += config .option .rsyncdir
Original file line number Diff line number Diff line change @@ -189,7 +189,6 @@ def test_crash():
189189 )
190190 assert result .ret == 1
191191
192- @pytest .mark .xfail (reason = "#527: Ignore Python 3.8 failure for the time being" )
193192 def test_distribution_rsyncdirs_example (self , testdir , monkeypatch ):
194193 # use a custom plugin that has a custom command-line option to ensure
195194 # this is propagated to workers (see #491)
You can’t perform that action at this time.
0 commit comments