File: unittests

package info (click to toggle)
python-stdnum 2.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,676 kB
  • sloc: python: 10,203; javascript: 6,995; sh: 13; makefile: 10
file content (26 lines) | stat: -rw-r--r-- 638 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
24
25
26
#!/bin/sh

set -ex

# testsuite - run tests in our test environment

# This runs most unit tests from the source package. It does not run the
# doctests that are embedded in the source code itself.

# Copy the test suite to the temporary directory
cp -rp tests "$AUTOPKGTEST_TMP/"

# Prepare config for pytest
cat > "$AUTOPKGTEST_TMP/pytest.ini" << EOM
[pytest]
addopts = --doctest-glob="*.doctest" tests
doctest_optionflags = NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL
EOM

# Run the tests from the temporary directory
for py in $(py3versions -r 2>/dev/null);
do
  cd "$AUTOPKGTEST_TMP"
  echo "Testing with $py:"
  $py -m pytest
done