File: run_test_in_testdir

package info (click to toggle)
adios4dolfinx 0.9.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 524 kB
  • sloc: python: 4,095; sh: 28; makefile: 7
file content (23 lines) | stat: -rwxr-xr-x 558 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

# Run build-time tests in build-time testdir,
# to avoid test output files appear in the build_dir
# (which is installed to the debian package)
#
# build_dir is provided as an argument to this script.
# No action is taken if it is not provided

build_dir=$1

if [ "x$build_dir" != "x" ]; then

# monkeypatch suggested at https://stackoverflow.com/a/62055409/12401525

cat >$build_dir/conftest.py  << END
import pytest
@pytest.fixture(autouse=True)
def change_test_dir(request, monkeypatch):
    monkeypatch.chdir(request.fspath.dirname)
END

fi