Esempio n. 1
0
 def test_getrsyncdirs(self, testdir):
     config = testdir.parseconfigure('--rsyncdir=' + str(testdir.tmpdir))
     nm = NodeManager(config, specs=[execnet.XSpec("popen")])
     assert not nm._getrsyncdirs()
     nm = NodeManager(config, specs=[execnet.XSpec("popen//chdir=qwe")])
     assert nm.roots
     assert testdir.tmpdir in nm.roots
Esempio n. 2
0
 def test_getrsyncdirs(self, pytester: pytest.Pytester) -> None:
     config = pytester.parseconfigure("--rsyncdir=" + str(pytester.path))
     nm = NodeManager(config, specs=[execnet.XSpec("popen")])
     assert not nm._getrsyncdirs()
     nm = NodeManager(config, specs=[execnet.XSpec("popen//chdir=qwe")])
     assert nm.roots
     assert pytester.path in nm.roots
Esempio n. 3
0
 def test_getrsyncdirs_with_conftest(self, testdir):
     p = py.path.local()
     for bn in 'x y z'.split():
         p.mkdir(bn)
     testdir.makeini("""
         [pytest]
         rsyncdirs= x
     """)
     config = testdir.parseconfigure(testdir.tmpdir, '--rsyncdir=y',
                                     '--rsyncdir=z')
     nm = NodeManager(config, specs=[execnet.XSpec("popen//chdir=xyz")])
     roots = nm._getrsyncdirs()
     # assert len(roots) == 3 + 1 # pylib
     assert py.path.local('y') in roots
     assert py.path.local('z') in roots
     assert testdir.tmpdir.join('x') in roots
Esempio n. 4
0
 def test_getrsyncdirs_with_conftest(self,
                                     pytester: pytest.Pytester) -> None:
     p = Path.cwd()
     for bn in ("x", "y", "z"):
         p.joinpath(bn).mkdir()
     pytester.makeini("""
         [pytest]
         rsyncdirs= x
     """)
     config = pytester.parseconfigure(pytester.path, "--rsyncdir=y",
                                      "--rsyncdir=z")
     nm = NodeManager(config, specs=[execnet.XSpec("popen//chdir=xyz")])
     roots = nm._getrsyncdirs()
     # assert len(roots) == 3 + 1 # pylib
     assert Path("y").resolve() in roots
     assert Path("z").resolve() in roots
     assert pytester.path.joinpath("x") in roots