port some acceptance tests over to copy_example

This commit is contained in:
Ronny Pfannschmidt
2018-06-26 22:59:40 +02:00
parent 0672bc633f
commit e860ff7299
6 changed files with 29 additions and 20 deletions

View File

@@ -635,7 +635,10 @@ class Testdir(object):
def copy_example(self, name):
example_dir = self.request.config.getini("pytester_example_dir")
example_path = self.request.config.rootdir.join(example_dir, name)
example_path.copy(self.tmpdir.join(example_path.basename))
if example_path.isdir() and not example_path.join("__init__.py").isfile():
example_path.copy(self.tmpdir)
else:
example_path.copy(self.tmpdir.join(example_path.basename))
Session = Session