diff --git a/wscript b/wscript index 9873db7..89a5d19 100644 --- a/wscript +++ b/wscript @@ -18,14 +18,7 @@ def options(opt): default=None, action="store", help="Run all tests that include the substring specified." - "Wildcards not allowed. (Used with --run_tests)", - ) - - opt.add_option( - "--pytest_basetemp", - default="pytest_temp", - help="Set the basetemp folder where pytest executes the tests", - ) + "Wildcards not allowed. (Used with --run_tests)") def configure(conf): @@ -109,23 +102,10 @@ def exec_test_pybind11(bld): # Install pytest in the virtualenv venv.run('python -m pip install pytest') - # We override the pytest temp folder with the basetemp option, - # so the test folders will be available at the specified location - # on all platforms. - basetemp = os.path.abspath(os.path.expanduser( - bld.options.pytest_basetemp)) - - # We need to manually remove the previously created basetemp folder, - # because pytest uses os.listdir in the removal process, and that fails - # if there are any broken symlinks in that folder. - if os.path.exists(basetemp): - waflib.extras.wurf.directory.remove_directory(path=basetemp) - testdir = bld.dependency_node("pybind11-source").find_node('tests') # Use -B to avoid writing any .pyc files - command = 'python -B -m pytest {} --basetemp {}'.format( - testdir.abspath(), basetemp) + command = 'python -B -m pytest {}'.format(testdir.abspath()) # Adds the test filter if specified if bld.options.test_filter: @@ -142,9 +122,10 @@ def exec_test_pybind11(bld): # tests = os.path.join(bld.dependency_path('pybind11-source'), 'tests') # if os.path.exists(tests): #for f in sorted(os.listdir('tests')): -# for f in ['test_class.py']: +# for f in ['test_iostream.py']: # if f.endswith('.py'): # test = os.path.join(tests, f) -# bld.cmd_and_log('{0} {1}\n'.format(python, test), env=env) +# bld.cmd_and_log( +# '{0} -B -m pytest {1}\n'.format(python, test), env=env)