Skip to content

Commit

Permalink
Merge pull request #352 from bashtage/add-pre-testing
Browse files Browse the repository at this point in the history
CI: Add prerelease testing
  • Loading branch information
bashtage authored Jan 5, 2024
2 parents 28cf0f6 + 6dde7ad commit 16dbe6c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
18 changes: 16 additions & 2 deletions ci/azure/azure_template_posix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ jobs:
NUMPY: 1.23.0
python312_latest:
python.version: '3.12'
python312_prerelease:
python.version: '3.12'
pip.pre: true
python38_mid_conda:
python.version: '3.8'
use.conda: true
Expand Down Expand Up @@ -119,7 +122,7 @@ jobs:
python -c "import randomgen; randomgen.test(['-n', 'auto', '--junitxml=../junit/test-results.xml'])"
popd
displayName: 'Run tests (site-packages)'
condition: eq(variables['test.install'], 'true')
condition: and(ne(variables['pip.pre'], 'true'), eq(variables['test.install'], 'true'))
- script: |
echo "Testing editable install"
Expand All @@ -129,7 +132,18 @@ jobs:
echo pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} randomgen/tests
pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} randomgen/tests
displayName: 'Run tests (editable)'
condition: ne(variables['test.install'], 'true')
condition: and(ne(variables['pip.pre'], 'true'), ne(variables['test.install'], 'true'))
- script: |
echo "Testing prerelease"
if [[ ${COVERAGE} == "true" ]]; then
export COVERAGE_OPTS="--cov-config .coveragerc --cov=randomgen --cov-report xml:coverage.xml --cov-report term"
fi
echo pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} randomgen/tests
pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} randomgen/tests
displayName: 'Run tests (pip pre)'
condition: eq(variables['pip.pre'], 'true')
continueOnError: true
- task: PublishTestResults@2
inputs:
Expand Down
8 changes: 7 additions & 1 deletion ci/azure/install-posix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fi
# Not all available in conda
python -m pip install setuptools "setuptools_scm[toml]<7" "oldest-supported-numpy" wheel pip black==22.6.0 isort flake8 --upgrade

EXTRA="pytest pytest-xdist coverage pytest-cov"
EXTRA="pytest pytest-xdist coverage pytest-cov colorama"

if [[ -n ${NUMPY} ]]; then CMD="$CMD~=${NUMPY}"; fi;
CMD="$CMD cython"
Expand All @@ -26,3 +26,9 @@ if [[ ${USE_CONDA} == "true" ]]; then CMD="$CMD numba"; fi;
if [[ ${USE_SCIPY} == "true" ]]; then CMD="$CMD scipy"; fi;
echo $CMD
eval $CMD


if [ "${PIP_PRE}" = true ]; then
python -m pip uninstall -y numpy pandas scipy
python -m pip install -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy pandas scipy --upgrade --use-deprecated=legacy-resolver
fi
3 changes: 1 addition & 2 deletions randomgen/tests/test_extended_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,7 @@ def test_random_uintegers():
assert isinstance(random.uintegers(), int)
assert isinstance(random.uintegers(bits=32), int)
with pytest.raises(ValueError):
with pytest.deprecated_call():
random.uintegers(bits=128)
random.uintegers(bits=128)


def test_str_repr():
Expand Down

0 comments on commit 16dbe6c

Please sign in to comment.